📄 00000007.htm
字号:
<HTML><HEAD> <TITLE>BBS水木清华站∶精华区</TITLE></HEAD><BODY><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER>WARNING OPTIONS <BR> Warnings are diagnostic messages that report constructions <BR> which are not inherently erroneous but which are risky or <BR> suggest there may have been an error. <BR> <BR> These options control the amount and kinds of warnings <BR> produced by GNU CC: <BR> <BR> -fsyntax-only <BR> Check the code for syntax errors, but don't emit <BR> any output. <BR> <BR> -w Inhibit all warning messages. <BR> <BR> -Wno-import <BR> Inhibit warning messages about the use of #import. <BR> <BR> -pedantic <BR> Issue all the warnings demanded by strict ANSI <BR> standard C; reject all programs that use forbidden <BR> extensions. <BR> <BR> Valid ANSI standard C programs should compile prop- <BR> erly with or without this option (though a rare few <BR> will require `-ansi'). However, without this op- <BR> tion, certain GNU extensions and traditional C fea- <BR> tures are supported as well. With this option, <BR> they are rejected. There is no reason to use this <BR> option; it exists only to satisfy pedants. <BR> <BR> `-pedantic' does not cause warning messages for use <BR> of the alternate keywords whose names begin and end <BR> with `__'. Pedantic warnings are also disabled in <BR> the expression that follows __extension__. Howev- <BR> er, only system header files should use these es- <BR> cape routes; application programs should avoid <BR> them. <BR> <BR> -pedantic-errors <BR> Like `-pedantic', except that errors are produced <BR> rather than warnings. <BR> <BR> -W Print extra warning messages for these events: <BR> <BR> o A nonvolatile automatic variable might be changed <BR> by a call to longjmp. These warnings are possible <BR> only in optimizing compilation. <BR> <BR> The compiler sees only the calls to setjmp. It <BR> cannot know where longjmp will be called; in fact, <BR> a signal handler could call it at any point in the <BR> code. As a result, you may get a warning even when <BR> there is in fact no problem because longjmp cannot <BR> in fact be called at the place which would cause a <BR> problem. <BR> <BR> o A function can return either with or without a val- <BR> ue. (Falling off the end of the function body is <BR> considered returning without a value.) For exam- <BR> ple, this function would evoke such a warning: <BR> <BR> foo (a) <BR> { <BR> if (a > 0) <BR> return a; <BR> } <BR> <BR> Spurious warnings can occur because GNU CC does not <BR> realize that certain functions (including abort and <BR> longjmp) will never return. <BR> <BR> o An expression-statement contains no side effects. <BR> <BR> o An unsigned value is compared against zero with `>' <BR> or `<='. <BR> <BR> <BR> -Wimplicit <BR> Warn whenever a function or parameter is implicitly <BR> declared. <BR> <BR> -Wreturn-type <BR> Warn whenever a function is defined with a return- <BR> type that defaults to int. Also warn about any re- <BR> turn statement with no return-value in a function <BR> whose return-type is not void. <BR> <BR> -Wunused <BR> Warn whenever a local variable is unused aside from <BR> its declaration, whenever a function is declared <BR> static but never defined, and whenever a statement <BR> computes a result that is explicitly not used. <BR> <BR> -Wswitch <BR> Warn whenever a switch statement has an index of <BR> enumeral type and lacks a case for one or more of <BR> the named codes of that enumeration. (The presence <BR> of a default label prevents this warning.) case <BR> labels outside the enumeration range also provoke <BR> warnings when this option is used. <BR> <BR> -Wcomment <BR> Warn whenever a comment-start sequence `/*' appears <BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -