DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Compiler diagnostics

C++ compiler diagnostics

The diagnostic messages produced by the C++ Compilation System are designed to be self-explanatory. Diagnostic messages have an associated severity:

In some cases violations of the C++ standard are diagnosed with a warning rather than an error; this behavior is still standards-conforming since the standard only requires a diagnostic of some kind.

Diagnostics are written to stderr with a form like the following:

   "test.c", line 5: a break statement may only be used within
             a loop or switch
       break;
       ^
Note that the message identifies the file and line involved, and that the source line itself (with position indicated by the caret ``^'') follows the message. If there are several diagnostics in one source line, each diagnostic will have the form above, with the result that the text of the source line will be displayed several times, with an appropriate position each time.

Long messages are wrapped to additional lines when necessary.

For some messages, a list of entities is useful; they are listed following the initial error message:

   "test.c", line 4: error: more than one instance of overloaded
             function "f" matches the argument list:
               function "f(int)"
               function "f(float)"
       f(1.5);
       ^
In some cases, some additional context information is provided; specifically, such context information is useful when the compiler issues a diagnostic while doing a template instantiation or while generating a constructor, destructor, or assignment operator function. For example:
   "test.c", line 7: error: "A::A()" is inaccessible
     B x;
        ^
             detected during implicit generation of "B::B()"
   	  at line 7
Without the context information, it may be difficult to figure out what the error refers to.
Previous topic: Other error messages

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005