关键词不能为空

当前您在: 主页 > 英语 >

gcc 常见的编译警告与错误(按字母顺序排列)

作者:高考题库网
来源:https://www.bjmy2z.cn/gaokao
2021-02-27 15:34
tags:

-

2021年2月27日发(作者:dadan)


gcc


常见的编译警告与错误(按字母顺序排列)




C


语言初学者遇到的最大问题往往是 看不懂编译错误,进而不知如何修改程序。有鉴于


此,


本附录罗 列了用


gcc


编译程序时经常出现的编译警告与错误。


需要提醒读者的是,


出现


警告(


warning


)并不影响目标程序的生成,但出现错误(

error


)则无法生成目标程序。


为便于读者查阅,


下面列出了经常遇到的警告与错误,


给出 了中英文对照


(英文按字典


顺序排列)


,并对部分错误与警告做了必要的解释。




#%s expects FILENAME


or …



#%s


需要



FILENAME









#%s is a deprecated GCC extension



#%s


是一个已过时的



GCC


扩展






#%s is a GCC extension



#%s


是一个



GCC


扩展






#~ error:




#~


错误:






#~ In file included from %s:%u



#~


在包含自



%s



%u


的文件中





#~ internal error:




#~


内部错误:






#~ no newline at end of file



#~


文件未以空白行结束




#~ warning:




#~


警告:






#elif after #else



#elif


出现在



#else







#elif without #if



#elif


没有匹配的



#if




#else after #else



#else


出现在



#else







#else without #if




1


#else


没有匹配的



#if





#endif without #if



#endif


没有匹配的



#if





#include nested too deeply



#include


嵌套过深






#include_next in primary source file



#include_next


出现在主源文件中






#pragma %s %s is already registered



#pragma %s %s


已经被注册






#pragma %s is already registered



#pragma %s


已经被注册






#pragma once in main file



#pragma once


出现在主文件中






#pragma system_header ignored outside include file



#pragma system_heade


在包含文件外被忽略






%.*s is not a valid universal character



%.*s


不是一个有效的



Unicode


字符






%s in preprocessing directive



预处理指示中出现



%s





%s is a block device



%s


是一个块设备






%s is shorter than expected



%s


短于预期






%s is too large



%s


过大






%s with no expression



%s


后没有表达式






%s: not used because `%.*s’ defined as `%s’ not `%.*s’



%s


:未使用因为‘


%.*s


’被定义为‘


%s


’ 而非‘


%*.s





2





%s: not used because `%.*s’ is poisoned



%s


:未 使用因为‘


%.*s


’已被投毒






%s: not used because `%.*s’ not def


ined



%s


:未使用因为‘


%.*s


’未定义






%s: not used because `%s’ is defined



%s< /p>


:未使用因为‘


%s


’已定义

< p>





%s: not used because `__COUNTER__’ is invalid



%s


:未使用因为 ‘


__COUNTER__


’无效






(%s is an alternative token for %s in C++)



(




C++


中“


%s


”会是“

%s


”的替代标识符


)





(this will be reported only once per input file)



(


此警告为每个输入文件只报告一次


)





%s after # is not a positive integer



#


后的“


%s


”不是一个正整数






%s after #line is not a positive integer



#line


后的“


%s


”不是一个正整数

< br>





%s cannot be used as a macro name as it is an operator in C++



%s


”不能被用作宏名,因为它是



C++


中的一个操作符





%s is not a valid filename




%s


”不 是一个有效的文件名






%s is not defined




%s


”未 定义






%s may not appear in macro parameter list




%s

< br>不能出现在宏参数列表中






%s re-asserted



重断言“


%s







%s redefined




%s


重定义






/* within comment




/*


出现在注释中






3





x used with no following hex digits



x


后没有



16


进制数字






defined cannot be used as a macro name




defi ned


不能被用作宏名






__COUNTER__ expanded inside directive with -fdirectives-only





-fdirectives-only




__COUNTER__


在指示中扩展






__V


A_ARGS__ can only appear in the expansion of a C99 variadic macro


__V


A_ARGS__


只能出现在



C99


可变参数宏的展开中






_Pragma takes a parenthesized string literal



_Pragma


需要一个括起的字符串字面常量







%.*s’ is not in NFC




%.*s


’不在



NFC








%.*s’ is not in NFKC




%.*s


’不在



NFKC








##’ cannot appear at either end of


a macro expansion




##


’不能出现在宏展开的两端







#’ is not followed by a macro parameter


< /p>



#


’后没有宏参数






$$’ in identifier or number




$$


’出现 在标识符或数字中







:’ without preceding ‘?’




:


’前没有‘


?








?’ without following ‘:’




?


’后没 有‘


:







'return' with a value, in function returning void



void


返回类型的函数中,


return


返回值。





protocol_type


重定义




anonymous variadic macros were introduced in C99




4



匿名可变参数宏在



C99


中被引入






assertion without predicate



断言后没有谓词






assertions are a deprecated extension



断言是一个已过时的



GCC


扩展






assertions are a GCC extension



断言是一个



GCC


扩展






assignment discards qualifiers from pointer target type


赋值时,取消了右值的限定。




assignment from incompatible pointer type


不兼容的指针间赋值




attempt to use poisoned %s



试图使用有毒的“


%s







backslash and newline separated by space



反斜杠和换行为空格所分隔






backslash- newline at end of file



反斜杠续行出现在文件末尾






binary constants are a GCC extension



二进制常量是一个



GCC


扩展






C++ style comments are not allowed in ISO C90



C++


风格的注释在



ISO C90


中不被允许






cannot find source file %s



找不到源文件



%s





Character %x might not be NFKC



字符



%x


可能不是



NFKC





character 0x%lx is not in the basic source character setn



字符



0x%lx


不在基本源字符集中


n





character 0x%lx is not unibyte in execution character set



字符



0x%lx


在执行字符集中不是单字节的







5


character constant too long for its type



字符常量大小超出其类型






comma operator in operand of #if



#if


操作数中出现逗号






comparison between pointer and integer


integer



pointer


比较




comparison is always false due to limited range of data type


由于数据类型范围的限制,比较结果一直为假




comparison is always true due to limited range of data type


由于数据类型范围的限制,比较结果一直为真。




conversion from %s to %s not supported by iconv



iconv


不支持从



%s




%s


的转换






converting escape sequence to execution character set



将转义序列转换到执行字符集






converting to execution character set



转换到可执行文件的字符集






converting UCN to execution character set





UCN


转换到执行字符集






converting UCN to source character set





UCN


转换到源字符集






could not determine date and time



无法决定日期与时间






could not determine file timestamp



无法决定文件的时间戳






CPP arithmetic must be at least as precise as a target int



CPP


算术必须至少具有目标



int


的精度






CPP half-integer narrower than CPP character



CPP


半整数短于



CPP


字符






CPP on this host cannot handle wide character constants over %lu bits, but the target requires %lu


bits




6


在此宿主机上,


CPP


不能处理长于



%lu


位的宽字符常量,但目标需要



%lu







cppchar_t must be an unsigned type



cppchar_t


必须是无符号型






current file is older than %s



当前文件早于



%s





decimal float constants are a GCC extension



十进制浮点常量是一个



GCC


扩展






detected recursion whilst expanding macro %s



展开宏

< p>
%s


时检测到递归






division by zero in #if



#if


中用零做除数






duplicate macro parameter %s



重复的宏参数“


%s







embedding a directive within macro arguments is not portable



将一个指示嵌入宏参数中是不可移植的






empty character constant



空的字符常量






empty filename in #%s



#%s


中文件名为空






expected expression before 'else'


else


之前无表达式




exponent has no digits



指数部分没有数字






extra tokens at end of #%s directive



#%s


指示的末尾有多余的标识符






failure to convert %s to %s



无法从



%s


转换到



%s





fixed-point constants are a GCC extension



定点常量是一个



GCC


扩展







7


floating constant in preprocessor expression



浮点常量出现在预处理表达式中






function-like macro %s must be used with arguments in traditional C



类似函数的宏“


%s


”在传统



C


中必须与参数一起使用






hex escape sequence out of range



16


进制转义序列越界






hexadecimal floating constants require an exponent



16


进制浮点常量需要指数部分





identifier %s is a special operator name in C++



标识符“


%s


”是



C++


中的一个特殊操作符






imaginary constants are a GCC extension



虚数常量是一个



GCC


扩展






imaginary number in preprocessor expression



预处理表达式中出现虚数






impossible operator ‘%u’



不可能的操作‘


%u







In _cpp_valid_ucn but not a UCN





_cpp_valid_ucn


中但不是一个



UCN





incompatible implicit declaration of built-in function 'printf'


与内置的


printf


函数隐式声明不兼容。




incomplete universal character name %.*s



不完全的



Unicode


字符名



%.*s





initialization discards qualifiers from pointer target type


初始化取消了指针目标类型的限定。




initialization from incompatible pointer type


不兼容指针类型的初始化




integer constant is so large that it is unsigned



整数常量太大,认定为



unsigned





integer constant is too large for its type



整数常量值超出其类型







8

-


-


-


-


-


-


-


-



本文更新与2021-02-27 15:34,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/674596.html

gcc 常见的编译警告与错误(按字母顺序排列)的相关文章

  • 余华爱情经典语录,余华爱情句子

    余华的经典语录——余华《第七天》40、我不怕死,一点都不怕,只怕再也不能看见你——余华《第七天》4可是我再也没遇到一个像福贵这样令我难忘的人了,对自己的经历如此清楚,

    语文
  • 心情低落的图片压抑,心情低落的图片发朋友圈

    心情压抑的图片(心太累没人理解的说说带图片)1、有时候很想找个人倾诉一下,却又不知从何说起,最终是什么也不说,只想快点睡过去,告诉自己,明天就好了。有时候,突然会觉得

    语文
  • 经典古训100句图片大全,古训名言警句

    古代经典励志名言100句译:好的药物味苦但对治病有利;忠言劝诫的话听起来不顺耳却对人的行为有利。3良言一句三冬暖,恶语伤人六月寒。喷泉的高度不会超过它的源头;一个人的事

    语文
  • 关于青春奋斗的名人名言鲁迅,关于青年奋斗的名言鲁迅

    鲁迅名言名句大全励志1、世上本没有路,走的人多了自然便成了路。下面是我整理的鲁迅先生的名言名句大全,希望对你有所帮助!当生存时,还是将遭践踏,将遭删刈,直至于死亡而

    语文
  • 三国群英单机版手游礼包码,三国群英手机单机版攻略

    三国群英传7五神兽洞有什么用那是多一个武将技能。青龙飞升召唤出东方的守护兽,神兽之一的青龙。玄武怒流召唤出北方的守护兽,神兽之一的玄武。白虎傲啸召唤出西方的守护兽,

    语文
  • 不收费的情感挽回专家电话,情感挽回免费咨询

    免费的情感挽回机构(揭秘情感挽回机构骗局)1、牛牛(化名)向上海市公安局金山分局报案,称自己为了挽回与女友的感情,被一家名为“实花教育咨询”的情感咨询机构诈骗4万余元。

    语文