What does “-Wall” in “g++ -Wall test.cpp -o test” do?

前端 未结 7 1783
萌比男神i
萌比男神i 2020-12-04 06:35

-o changes the output filename (I found that using --help)

But I can\'t find out what -Wall does?

7条回答
  •  悲哀的现实
    2020-12-04 06:53

    It enables warnings which are deemed useful and easy to avoid at the source by gcc writers. There is also -W (-Wextra in newer releases) which are deemed useful but for which work-arounding false positives can be difficult or result in clumsy code.

    gcc has also a bunch of other warnings, generally less useful. See http://gcc.gnu.org/onlinedocs/gcc-4.4.3/gcc/Warning-Options.html#Warning-Options

提交回复
热议问题