-Wformat-overflow=1 -Wformat启用的-Wformat-overflow的第1级采用了一种保守的方法,只警告最有可能溢出缓冲区的调用。 在此级别,格式化具有未知值的指令的数字参数假定值为1,未知长度的字符串为空。 已知绑定到其类型的子范围的数字参数,或者其输出受其指令的精度或有限的字符串文字限制的字符串参数被假定为取值范...
-Wenum-conversion in C/ObjC; -Wformat -Wformat-overflow -Wformat-truncation -Wint-in-bool-context -Wimplicit (C and Objective-C only) -Wimplicit-int (C and Objective-C only) -Wimplicit-function-declaration (C and Objective-C only) -Winit-self (only for C++) -Wlogical-not-parentheses -...
-Wformat-extra-args 当传递给格式字符串的参数太多时给出警告 -Wformat-nonliteral 当格式字符串不是字面值时给出警告 -Wformat-security 当使用格式字符串的函数可能导致安全问题时给出警告 -Wformat-y2k 当 strftime 格式给出 2位记年时给出警告 -Wformat-zero-length 对长度为 0 的格式字符串给出警告 ...
-Wformat-nonliteral 当格式字符串不是字面值时给出警告 -Wformat-security 当使用格式字符串的函数可能导致安全问题时给出警告 -Wformat-y2k 当 strftime 格式给出 2 位记年时给出警告 -Wformat-zero-length 对长度为 0 的格式字符串给出警告 -Wformat= 此开关缺少可用文档 ...
gcc -Wformat test_format.ctest_format.c: In function `main':test_format.c:10: warning: int format, long int arg (arg 2)test_format.c:11: warning: int format, double arg (arg 2) 输出:11078711746 1.4 [-Wimplicit] [-Wimplicit]该警告选项实际上是-Wimplicit-int和-Wimplicit-function-decl...
Wformat-contains-nul -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-signedness - Wformat-y2k -Wformat-zero-length -Wfree-nonheap-object -Wfunction-elimination -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wimplicit-interface -Wimplicit-procedure -...
-Wformat -Wmain (only for C/ObjC and unless -ffreestanding) -Wmaybe-uninitialized -Wmissing-braces (only for C/ObjC) -Wnonnull -Wopenmp-simd -Wparentheses -Wpointer-sign -Wreorder -Wreturn-type -Wsequence-point -Wsign-compare (only in C++) ...
[-Wformat-overflow=] sprintf((char*)tmp_hash, "(G%s)", buffer); ^~ ~~~ In file included from /usr/include/stdio.h:862, from misc.h:20, from DOMINOSEC8_fmt_plug.c:46: /usr/include/x86_64-linux-gnu/bits/stdio2.h:33:10: note: ‘__builtin___sprintf_chk’ output between...
-Wenum-int-mismatch (C and Objective-C only) -Wformat=1 -Wformat-contains-nul -Wformat-diag -Wformat-extra-args -Wformat-overflow=1 -Wformat-truncation=1 -Wformat-zero-length -Wframe-address -Wimplicit (C and Objective-C only) -Wimplicit-function-declaration (C and Objective-C only) -Wi...
-Wformat-extra-args 当传递给格式字符串的参数太多时给出警告 -Wformat-nonliteral 当格式字符串不是字面值时给出警告 -Wformat-security 当使用格式字符串的函数可能导致安全问题时给出警告 -Wformat-y2k 当 strftime 格式给出 2位记年时给出警告 -Wformat-zero-length 对长度为 0 的格式字符串给出警告 -Wform...