例如,某些机器上只能在2或4字节边界上访问整数,如果在这种机型上把char *强制转换成int *类型, 编译器就发出警告。 ◆sign-compare:将有符号类型和无符号类型数据进行比较时发出警告。 ◆missing-prototypes :如果没有预先声明函数原形就定义了全局函数,编译器就发出警告。即使函数定义自身提供了函数原形也会产生这个...
} gcc -Wsign-compare test_sign_compare.c test_sign_compare.c: In function `main': test_sign_compare.c:10: warning: comparison between signed and unsigned 输出: i < j [-Waggregate-return] 如果一个函数返回一个聚合类型,如结构体、联合或者数组,该选项就会给出警告信息。较简单不举例了。 [-W...
gcc -pthread -Wno-unused-result -Wno-sign-compare -DNDEBUG -O2 -g -pipe -Wall -o output_filename source_file.c 在这个示例中,output_filename是编译后生成的可执行文件名,source_file.c是源文件名。你可以根据实际情况替换这两个文件名。 4. (可选) 解释如何根据实际需求调整GCC命令行参数 根据实...
命令gcc -Q --help=warning提供所有受支持的警告选项的列表,以及有关它们是否处于活动状态的信息。这可以通过方式来找出哪个选项(不)例如通过启用-Wall和-Wextragcc -Wall -Wextra -Q --help=warning要启用所有警告,您可以使用一些正则表达式提取命令行参数gcc -Q --help=warning | sed -e 's/^\s*\(\-\S...
o -std=c++17 -O3 -Wno-delete-incomplete -Wno-sign-compare cc1plus: warning: command line ...
sign- compare:当使⽤signed和unsigned类型⽐较时;missing-prototypes:当函数在使⽤前没有函数原型时;packed:packed 是gcc的⼀个扩展,是使结构体各成员之间不留内存对齐所需的,有时候会造成内存对齐的问题;padded:也是gcc的扩展,使结构体成员之间进⾏内存对齐的填充,会造成结构体体积增⼤.unreachable-code:...
Sign up or log in Sign up using Google Sign up using Email and Password Post as a guest Name Email Required, but never shown Post Your Answer By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy. Browse ot...
sign -Wpointer-to-int-cast -Wpragmas -Wproperty-assign-default -Wprotocol -Wredundant-decls -Wreorder -Wreturn-local-addr -Wreturn-type -Wselector -Wsequence-point -Wshadow -Wsign-compare -Wsign-promo -Wsizeof-pointer-memaccess -Wstack-protector -Wstrict-null-sentinel -Wstrict-prototypes -...
make[1]: Entering directory `/home/ec2-user/downloads/QuantLib-SWIG-1.8/Python'CXXFLAGS="-O3 -fno-strict-aliasing -Wno-unused -Wno-uninitialized -Wno-sign-compare -Wno-write-strings"CC="gcc"CXX="g++"/opt/anaconda/anaconda2/bin/python setup.py build ...
(only for C/ObjC and unless -ffreestanding) -Wmissing-braces -Wnonnull -Wparentheses -Wpointer-sign -Wreorder -Wreturn-type -Wsequence-point -Wsign-compare (only in C++) -Wstrict-aliasing -Wstrict-overflow=1 -Wswitch -Wtrigraphs -Wuninitialized (only with -O1 and above) -Wunknown-pragma...