GCC -Wall

本文详细介绍了 GCC 4.7.2 编译器中 -Wall 选项所包含的各种警告标志,这些标志帮助开发者识别并避免潜在的问题代码。文章覆盖了 C/C++/Objective-C 的特定警告,例如未初始化变量、不安全的类型转换等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

官网:http://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Warning-Options.html#Warning-Options
3.8 Options to Request or Suppress Warnings
.....
-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.
-Wall turns on the following warning flags:

          -Waddress   
          -Warray-bounds (only with -O2)  
          -Wc++11-compat  
          -Wchar-subscripts  
          -Wenum-compare (in C/Objc; this is on by default in C++) 
          -Wimplicit-int (C and Objective-C only) 
          -Wimplicit-function-declaration (C and Objective-C only) 
          -Wcomment  
          -Wformat   
          -Wmain (only for C/ObjC and unless -ffreestanding)  
          -Wmaybe-uninitialized 
          -Wmissing-braces  
          -Wnonnull  
          -Wparentheses  
          -Wpointer-sign  
          -Wreorder   
          -Wreturn-type  
          -Wsequence-point  
          -Wsign-compare (only in C++)  
          -Wstrict-aliasing  
          -Wstrict-overflow=1  
          -Wswitch  
          -Wtrigraphs  
          -Wuninitialized  
          -Wunknown-pragmas  
          -Wunused-function  
          -Wunused-label     
          -Wunused-value     
          -Wunused-variable  
          -Wvolatile-register-var 

 

http://wenku.baidu.com/link?url=gbKosrdpS_vhpyXIdn11qWOssqdxMhvjdxGw6LPgQ2Wr5Py_e5O8FRdLvoZ8tLRhA-SL6VUVYz2gqOf6AsOmn1UOeTig-B8pBK_fL6sdpYq

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值