2016-09-12 33 views

回答

1

試試 - W所有與captial W.命令行選項是大小寫敏感的。

-Wall This enables all the warnings about constructions that some users consider questionable, and that are easy to avoid (or modify to prevent the warning), even in conjunction with macros. This also enables some language-specific warnings described in C++ Dialect Options and Objective-C and Objective-C++ Dialect Options.

而對於werror,使用 - W¯¯誤差captialW¯¯

-Werror= Make the specified warning into an error. The specifier for a warning is appended; for example -Werror=switch turns the warnings controlled by -Wswitch into errors. This switch takes a negative form, to be used to negate -Werror for specific warnings; for example -Wno-error=switch makes -Wswitch warnings not be errors, even when -Werror is in effect. The warning message for each controllable warning includes the option that controls the warning. That option can then be used with -Werror= and -Wno-error= as described above. (Printing of the option in the warning message can be disabled using the -fno-diagnostics-show-option flag.)

Note that specifying -Werror=foo automatically implies -Wfoo. However, -Wno-error=foo does not imply anything.

https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

+0

這麼低質量的帖子不值得回答。 – SergeyA

+1

在你的opnion?我只是試圖幫助那些顯然是新人的人,這是一個很容易忽略的新事物。 – Tschallacka

+0

此外,當在谷歌搜索,在第一個結果中沒有新手友好的答案,所以這可能實際上是一個有用的問題stackoverflow。 – Tschallacka