Making GCC and Other C++ Compilers Very Strict

后端 未结 7 891
深忆病人
深忆病人 2021-02-01 06:45

I\'m working on a large collaborative C++ project that is both developed and run on various flavors of Linux, OS X and Windows. We compile across these platforms with GCC, Visua

7条回答
  •  感动是毒
    2021-02-01 07:27

    Copy and paste below line into your master cmake file. below line comprises almost most useful compiler flags in order to test yourself more stricter.

    set(CMAKE_CXX_FLAGS "-O0 -fno-elide-constructors -pedantic-errors -ansi -Wextra -Wall     -Winit-self -Wold-style-cast -Woverloaded-virtual -Wuninitialized -Wmissing-declarations    -Winit-self -std=c++98")
    

    If you dont use cmake just copy flags that in double quotes and send to your compiler

提交回复
热议问题