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

上传人:b****5 文档编号:14281209 上传时间:2023-06-22 格式:DOCX 页数:19 大小:21.87KB
下载 相关 举报
gcc常见的编译警告与错误按字母顺序排列.docx_第1页
第1页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第2页
第2页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第3页
第3页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第4页
第4页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第5页
第5页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第6页
第6页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第7页
第7页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第8页
第8页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第9页
第9页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第10页
第10页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第11页
第11页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第12页
第12页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第13页
第13页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第14页
第14页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第15页
第15页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第16页
第16页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第17页
第17页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第18页
第18页 / 共19页
gcc常见的编译警告与错误按字母顺序排列.docx_第19页
第19页 / 共19页
亲,该文档总共19页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

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

《gcc常见的编译警告与错误按字母顺序排列.docx》由会员分享,可在线阅读,更多相关《gcc常见的编译警告与错误按字母顺序排列.docx(19页珍藏版)》请在冰点文库上搜索。

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

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

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

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

有鉴于此,本附录罗列了用gcc编译程序时经常出现的编译警告与错误。

需要提醒读者的是,出现警告(warning)并不影响目标程序的生成,但出现错误(error)则无法生成目标程序。

为便于读者查阅,下面列出了经常遇到的警告与错误,给出了中英文对照(英文按字典顺序排列),并对部分错误与警告做了必要的解释。

#%sexpects\FILENAME\or…

#%s需要\FILENAME\或…

#%sisadeprecatedGCCextension

#%s是一个已过时的GCC扩展

#%sisaGCCextension

#%s是一个GCC扩展

#~error:

#~错误:

#~Infileincludedfrom%s:

%u

#~在包含自%s:

%u的文件中

#~internalerror:

#~内部错误:

#~nonewlineatendoffile

#~文件未以空白行结束

#~warning:

#~警告:

#elifafter#else

#elif出现在#else后

#elifwithout#if

#elif没有匹配的#if

#elseafter#else

#else出现在#else后

#elsewithout#if

#else没有匹配的#if

#endifwithout#if

#endif没有匹配的#if

#includenestedtoodeeply

#include嵌套过深

#include_nextinprimarysourcefile

#include_next出现在主源文件中

#pragma%s%sisalreadyregistered

#pragma%s%s已经被注册

#pragma%sisalreadyregistered

#pragma%s已经被注册

#pragmaonceinmainfile

#pragmaonce出现在主文件中

#pragmasystem_headerignoredoutsideincludefile

#pragmasystem_heade在包含文件外被忽略

%.*sisnotavaliduniversalcharacter

%.*s不是一个有效的Unicode字符

%sinpreprocessingdirective

预处理指示中出现%s

%sisablockdevice

%s是一个块设备

%sisshorterthanexpected

%s短于预期

%sistoolarge

%s过大

%swithnoexpression

%s后没有表达式

%s:

notusedbecause`%.*s’definedas`%s’not`%.*s’

%s:

未使用因为‘%.*s’被定义为‘%s’而非‘%*.s’

%s:

notusedbecause`%.*s’ispoisoned

%s:

未使用因为‘%.*s’已被投毒

%s:

notusedbecause`%.*s’notdefined

%s:

未使用因为‘%.*s’未定义

%s:

notusedbecause`%s’isdefined

%s:

未使用因为‘%s’已定义

%s:

notusedbecause`__COUNTER__’isinvalid

%s:

未使用因为‘__COUNTER__’无效

(\%s\isanalternativetokenfor\%s\inC++)

(在C++中“%s”会是“%s”的替代标识符)

(thiswillbereportedonlyonceperinputfile)

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

\%s\after#isnotapositiveinteger

#后的“%s”不是一个正整数

\%s\after#lineisnotapositiveinteger

#line后的“%s”不是一个正整数

\%s\cannotbeusedasamacronameasitisanoperatorinC++

“%s”不能被用作宏名,因为它是C++中的一个操作符

\%s\isnotavalidfilename

“%s”不是一个有效的文件名

\%s\isnotdefined

“%s”未定义

\%s\maynotappearinmacroparameterlist

“%s不能出现在宏参数列表中

\%s\re-asserted

重断言“%s”

\%s\redefined

“%s重定义

\/*\withincomment

“/*出现在注释中

\\xusedwithnofollowinghexdigits

\\x后没有16进制数字

\defined\cannotbeusedasamacroname

“defined不能被用作宏名

__COUNTER__expandedinsidedirectivewith-fdirectives-only

带-fdirectives-only时__COUNTER__在指示中扩展

__VA_ARGS__canonlyappearintheexpansionofaC99variadicmacro

__VA_ARGS__只能出现在C99可变参数宏的展开中

_Pragmatakesaparenthesizedstringliteral

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

‘%.*s’isnotinNFC

‘%.*s’不在NFC中

‘%.*s’isnotinNFKC

‘%.*s’不在NFKC中

‘##’cannotappearateitherendofamacroexpansion

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

‘#’isnotfollowedbyamacroparameter

‘#’后没有宏参数

‘$’inidentifierornumber

‘$’出现在标识符或数字中

‘:

’withoutpreceding‘?

‘:

’前没有‘?

‘?

’withoutfollowing‘:

‘?

’后没有‘:

'return'withavalue,infunctionreturningvoid

在void返回类型的函数中,return返回值。

"protocol_type"redefined

protocol_type重定义

anonymousvariadicmacroswereintroducedinC99

匿名可变参数宏在C99中被引入

assertionwithoutpredicate

断言后没有谓词

assertionsareadeprecatedextension

断言是一个已过时的GCC扩展

assertionsareaGCCextension

断言是一个GCC扩展

assignmentdiscardsqualifiersfrompointertargettype

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

assignmentfromincompatiblepointertype

不兼容的指针间赋值

attempttousepoisoned\%s\

试图使用有毒的“%s”

backslashandnewlineseparatedbyspace

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

backslash-newlineatendoffile

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

binaryconstantsareaGCCextension

二进制常量是一个GCC扩展

C++stylecommentsarenotallowedinISOC90

C++风格的注释在ISOC90中不被允许

cannotfindsourcefile%s

找不到源文件%s

Character%xmightnotbeNFKC

字符%x可能不是NFKC

character0x%lxisnotinthebasicsourcecharacterset\n

字符0x%lx不在基本源字符集中\n

character0x%lxisnotunibyteinexecutioncharacterset

字符0x%lx在执行字符集中不是单字节的

characterconstanttoolongforitstype

字符常量大小超出其类型

commaoperatorinoperandof#if

#if操作数中出现逗号

comparisonbetweenpointerandinteger

integer与pointer比较

comparisonisalwaysfalseduetolimitedrangeofdatatype

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

comparisonisalwaystrueduetolimitedrangeofdatatype

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

conversionfrom%sto%snotsupportedbyiconv

iconv不支持从%s到%s的转换

convertingescapesequencetoexecutioncharacterset

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

convertingtoexecutioncharacterset

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

convertingUCNtoexecutioncharacterset

将UCN转换到执行字符集

convertingUCNtosourcecharacterset

将UCN转换到源字符集

couldnotdeterminedateandtime

无法决定日期与时间

couldnotdeterminefiletimestamp

无法决定文件的时间戳

CPParithmeticmustbeatleastaspreciseasatargetint

CPP算术必须至少具有目标int的精度

CPPhalf-integernarrowerthanCPPcharacter

CPP半整数短于CPP字符

CPPonthishostcannothandlewidecharacterconstantsover%lubits,butthetargetrequires%lubits

在此宿主机上,CPP不能处理长于%lu位的宽字符常量,但目标需要%lu位

cppchar_tmustbeanunsignedtype

cppchar_t必须是无符号型

currentfileisolderthan%s

当前文件早于%s

decimalfloatconstantsareaGCCextension

十进制浮点常量是一个GCC扩展

detectedrecursionwhilstexpandingmacro\%s\

展开宏%s时检测到递归

divisionbyzeroin#if

#if中用零做除数

duplicatemacroparameter\%s\

重复的宏参数“%s”

embeddingadirectivewithinmacroargumentsisnotportable

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

emptycharacterconstant

空的字符常量

emptyfilenamein#%s

#%s中文件名为空

expectedexpressionbefore'else'

else之前无表达式

exponenthasnodigits

指数部分没有数字

extratokensatendof#%sdirective

#%s指示的末尾有多余的标识符

failuretoconvert%sto%s

无法从%s转换到%s

fixed-pointconstantsareaGCCextension

定点常量是一个GCC扩展

floatingconstantinpreprocessorexpression

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

function-likemacro\%s\mustbeusedwithargumentsintraditionalC

类似函数的宏“%s”在传统C中必须与参数一起使用

hexescapesequenceoutofrange

16进制转义序列越界

hexadecimalfloatingconstantsrequireanexponent

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

identifier\%s\isaspecialoperatornameinC++

标识符“%s”是C++中的一个特殊操作符

imaginaryconstantsareaGCCextension

虚数常量是一个GCC扩展

imaginarynumberinpreprocessorexpression

预处理表达式中出现虚数

impossibleoperator‘%u’

不可能的操作‘%u’

In_cpp_valid_ucnbutnotaUCN

在_cpp_valid_ucn中但不是一个UCN

incompatibleimplicitdeclarationofbuilt-infunction'printf'

与内置的printf函数隐式声明不兼容。

incompleteuniversalcharactername%.*s

不完全的Unicode字符名%.*s

initializationdiscardsqualifiersfrompointertargettype

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

initializationfromincompatiblepointertype

不兼容指针类型的初始化

integerconstantissolargethatitisunsigned

整数常量太大,认定为unsigned

integerconstantistoolargeforitstype

整数常量值超出其类型

integeroverflowinpreprocessorexpression

预处理表达式中整数溢出

invalid#%sdirective

无效的#%s指示

invalid#pragmaGCCpoisondirective

无效的#pragmaGCCpoison指示

invalid#pragmapop_macrodirective

无效的#pragmapop_macro指示

invalid#pragmapush_macrodirective

无效的#pragmapush_macro指示

invalidbuilt-inmacro\%s\

无效的内建宏“%s”

invalidcharacter‘%c’inrawstringdelimiter

原始字符串分隔符中有无效字符‘%c’

invaliddigit\%c\inbinaryconstant

二进制常量中有无效数字“%c

invaliddigit\%c\inoctalconstant

8进制常量中有非法字符“%c

invalidflag\%s\inlinedirective

line指示中有无效的标记“%s

invalidhashtype%dincpp_macro_definition

cpp_macro_definition中有无效的散列类型%d

invalidprefix\0b\forfloatingconstant

浮点常量的“0b前缀无效

invalidpreprocessingdirective#%s

无效的预处理指示#%s

invalidstorageclassforfunction'XXXXXX'

在文件的某个地方,丢失了一个大括号‘}’

invalidstringliteral,ignoringfinal‘\\’

无效的字面字符串,忽略最后的‘\\’

invalidsuffix\%.*s\onfloatingconstant

浮点常量的“%.*s后缀无效

invalidsuffix\%.*s\onintegerconstant

整数常量的“%.*s后缀无效

invalidsuffix\%.*s\withhexadecimalfloatingconstant

十六进制浮点常量的“%.*s后缀无效

invokingmacro%sargument%d:

emptymacroargumentsareundefinedinISOC90andISOC++98

调用宏%s的参数%d:

空的宏参数未被ISOC90和ISOC++98定义

ISOCdoesnotpermitnamedvariadicmacros

ISOC不允许有名的可变参数宏

ISOC99requiresrestargumentstobeused

ISOC99需要使用剩余的参数

ISOC99requireswhitespaceafterthemacroname

ISOC99要求宏名后必须有空白

linenumberoutofrange

行号超出范围

lvaluerequiredasleftoperandofassignment

左值问题

macro\%s\isnotused

宏“%s”未被使用

macro\%s\passed%uarguments,buttakesjust%u

宏“%s”传递了%u个参数,但只需要%u个

macro\%s\requires%uarguments,butonly%ugiven

宏“%s需要%u个参数,但只给出了%u个

macroargument\%s\wouldbestringifiedintraditionalC

宏参数“%s”将在传统C中被字符串化

macronamesmustbeidentifiers

宏名必须是标识符

macroparametersmustbecomma-separated

宏参数必须由逗号隔开

missing‘(‘afterpredicate

谓词后缺少‘(’

missing‘(‘inexpression

表达式中缺少‘(’

missing‘)’after\defined\"

“defined后出现‘)’

missing‘)’inexpression

表达式中缺少‘)’

missing‘)’inmacroparameterlist

在宏参数表中缺少‘)’

missing‘)’tocompleteanswer

完整的答案缺少‘)’

missingbinaryoperatorbeforetoken\%s\

标识符“%”s前缺少二元运算符

missingexpressionbetween‘(‘and‘)’

‘(’与‘)’之间缺少表达式

missingterminating%ccharacter

缺少结尾的%c字符

missingterminating>character

缺少结尾的>字符

missingwhitespaceafterthemacroname

宏名后缺少空白

multi-charactercharacterconstant

多字节字符常量

multi-linecomment

多行注释

Multipleincludeguardsmaybeusefulfor:

\n

多个防止重包含可能对其有用:

\n

noiconvimplementation,cannotconvertfrom%sto%s

没有iconv的实现,无法从%s转换到%s

noincludepathinwhichtosearchfor%s

没有包含路径可供搜索%s

nomacronamegivenin#%sdirective

#%s指示中未给出宏名

nonewlineatendoffile

在文件最后一行加上回车键

解释:

在“RationalefortheC99standard”一文中,有C99的相关信息:

Abackslashimmediatelybeforeanewlinehaslongbeenusedtocontinuestringliterals,aswellaspreprocessingcommandlines.IntheinterestofeasingmachinegenerationofC,andoftransportingcodetomachineswithrest

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > IT计算机 > 电脑基础知识

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2