Warning Messages And Error Messages - Red Hat ENTERPRISE LINUX 4 Manual

Hide thumbs Also See for ENTERPRISE LINUX 4:
Table of Contents

Advertisement

298
There is no guarantee (in either the C or the C++ standard language definitions) that the increments
will be evaluated in any particular order. Either increment might happen first.
arguments
, or it might get
2, 3
Not allowing structures with volatile fields in registers.
Strictly speaking, there is no prohibition in the ISO C standard against allowing structures with
volatile fields in registers, but it does not seem to make any sense and is probably not what you
wanted to do. So the compiler will give an error message in this case.
Making certain warnings into errors by default.
Some ISO C testsuites report failure when the compiler does not produce an error message for a
certain program.
ISO C requires a "diagnostic" message for certain kinds of invalid programs, but a warning is
defined by GCC to count as a diagnostic. If GCC produces a warning but not an error, that is
correct ISO C support. If testsuites call this "failure", they should be run with the GCC option
-pedantic-errors

11.12. Warning Messages and Error Messages

The GNU compiler can produce two kinds of diagnostics: errors and warnings. Each kind has a dif-
ferent purpose:
• Errors report problems that make it impossible to compile your program. GCC reports errors with
the source file name and line number where the problem is apparent.
• Warnings report other unusual conditions in your code that may indicate a problem, although com-
pilation can (and does) proceed. Warning messages also report the source file name and line number,
but include the text
Warnings may indicate danger points where you should check to make sure that your program really
does what you intend; or the use of obsolete features; or the use of nonstandard features of GNU C
or C++. Many warnings are issued only if you ask for them, with one of the
requests a variety of useful warnings).
-Wall
GCC always tries to compile your program if possible; it never gratuitously rejects a program whose
meaning is clear merely because (for instance) it fails to conform to a standard. In some cases, how-
ever, the C and C++ standards specify that certain extensions are forbidden, and a diagnostic must
be issued by a conforming compiler. The
cases;
-pedantic-errors
constructs get warnings or errors.
Section 4.8 Options to Request or Suppress Warnings, for more detail on these and related command-
line options.
, or even
3, 2
, which will turn these warnings into errors.
to distinguish them from error messages.
warning:
says to make them errors instead. This does not mean that all non-ISO
Chapter 11. Known Causes of Trouble with GCC
.
2, 2
option tells GCC to issue warnings in such
-pedantic
might get the
func
options (for instance,
-W

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 4 and is the answer not in the manual?

Questions and answers

Table of Contents