【问题标题】:gcc -W warning flagsgcc -W 警告标志
【发布时间】:2023-04-08 08:09:02
【问题描述】:

我正在学习 C,在一些示例中我发现“使用 gcc -W 启用警告”,

但是在这里阅读文档:http://gcc.gnu.org/onlinedocs/gcc-4.6.3/gcc/Warning-Options.html

我找不到 -W 的作用。

谁能解释一下?

我说的是 W 而不是 w。

问候,

【问题讨论】:

标签: c gcc


【解决方案1】:

-W 现在已被 -Wextra 弃用,并带有新的 gcc 版本。

来自gcc 手册页:

   -Wextra
       This enables some extra warning flags that are not enabled by -Wall.
       (This option used to be called -W.  The older name is still supported, but
       the newer name is more descriptive.)

【讨论】:

  • 是 -Wextra(-Wall + 其他选项)还是(选项不在 -Wall 中)?
  • @Scooter -Wextra-Wall 未启用的警告,所以如果你想同时使用警告:-Wall -Wextra
猜你喜欢
  • 2023-03-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-07-17
  • 2011-07-14
  • 1970-01-01
相关资源
最近更新 更多