开发者

Where to find a full list of gcc warnings and errors?

Sometimes I need to use a gcc for cross-platf开发者_StackOverflow社区orm work, and sometimes gcc really amuses me with its warnings. For example:

#pragma once in a main file

This is very informative warning, but I really don't know what a 'main file' IS in terminology of gcc and WHY it must not contain #pragma once :). So, does any documentation exist that covers all gcc warnings and errors (mostly warnings, errors are trivial) with some comments on them?


The objective of '#pragma once' is to prevent a header from being reincluded. If you have it in a source file (usually a '.c' file), you won't be reading that twice (normally - I do know of a source file that reincludes itself [and I don't like it]; it does not use or want #pragma once, though!). So, a 'main file' in this context is one listed on the command line, for instance, rather than a header.

As to the subject matter of the question - the GCC manual does not seem to have a comprehensive list. I don't know whether there actually is one.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜