-Wpointer-arith 当在算术表达式中使用函数指针时给出警告 -Wpointer-sign 赋值时如指针符号不一致则给出警告 -Wpointer-to-int-cast 将一个指针转换为大小不同的整数时给出警告 -Wpragmas 对错误使用的 pragma 加以警告 -Wproperty-assign-default Warn if a property for an O
静态语言的好处就是变量强制必须指定类型,这也是编译的要求,所以大部分编译型的语言都会有强制变量类型的...
还需要-Wextra。您-Wextra可能认为可以解决问题,但不能!并非所有此处列出的警告(例如-Wshadow)都已启...
parameter name missing 缺少形参名 passing argument 1 of send makes pointer from integer without a cast 函数 send 的第一个 integer 型参数没有强制转换为 pointer 型 pasting \%s\ and \%s\ does not give a valid preprocessing token 毗连“ %s”和“ %s”不能给出一个有效的预处理标识符 poisoning ...
34、cards qualifiers from pointer target type12、 mes_函数第一个参数的传递,丢弃了指针目标类型限定。 parameter name missing 缺少形参名 passing argument 1 of 'send' makes pointer from integer without a cast函数send的第一个integer型参数没有强制转换为pointer型 pasting %s and %s does not give a va...
int main() { int a = 1; int b = 2; int c = 0; // ok just test\ c = a + b; /* * 这里我们期待c = 3 * /* 但实际上输出c = 0 */ printf("the c is %d\n", c); return 0; } gcc -Wcomment test_comment.c
gcc常见错误解析 GCC ³£¼û´íÎó½âÎö Ò»¡¢´íÎóÀàÐÍ µÚÒ»Àà∶C Óï·¨´íÎó ´íÎóÐÅÏ¢∶Îļþsource.c ÖеÚn ÐÐÓÐÓï·¨´íÎó(syntex errror)¡£ ÕâÖÖÀà...
-fno-rtti如果没有使用'dynamic_cast'和'typeid',可以使用这个选项禁止为包含虚方法的类生成运行时表示代码,从而节约空间。此选项对于异常处理无效(仍然按需生成rtti代码)。-ftemplate-depth-n将最大模版实例化深度设为'n',符合标准的程序不能超过17,默认值为500。-fno-optional-diags禁止输出诊断消息,C++标准并...
int main () { char c = 255; // 我们以为char是无符号的,其范围应该是[0,255] int i = 0; int a[256]; for (i = 0; i type `char’ 其输出结果: -1 -41Array7476 1 从输出结果来看Solaris Array/gcc 3.2上char默认实现类型为signed char;在Windows XP/gcc-3.4.2上也是一样。
int main() { int a = 1; int b = 2; int c = 0; // ok just test\ c = a + b; /* * 这里我们期待c = 3 * /* 但实际上输出c = 0 */ printf("the c is %d\n", c); return 0; } gcc -Wcomment test_comment.c