|
|
This subtopic contains the text and explanation for all the warning and error messages produced by the C compiler. All messages are given as they appear in the C locale. The messages are listed in alphanumeric order (special characters are ignored). Numbers precede capital letters and capital letters precede lowercase letters. n, when it represents a number, comes at the beginning of the list.
The message entries are formatted as follows:
Entry | Comment |
---|---|
n extra byte(s) in string literal initializer ignored | Text of message. |
Type: Warning Options: all | Type of message and command-line options which must be set for the message to appear (``all'' indicates that the message is independent of options). |
A string literal that initializes a character array contains n more characters than the array can hold. | Explanation of message. |
char ca[3] = "abcd"; | Example of code that might generate the message. |
"file", line 1: warning: 1 extra byte(s) in string
literal initializer ignored | Message output. |
When an error occurs, the error message is preceded by a file name and line number. All messages output are one line long (no newline characters). The line number is usually the line on which a problem has been diagnosed. Occasionally the compiler must read the next token before it can diagnose a problem, in which case the line number in the message may be a higher line number than that of the offending line.
UX:acomp:type: error_message
where type is either WARNING
or ERROR
depending on the type of message. error_message
is the message output as shown above.
Note that lint issues all the messages listed in this topic, and additional messages about potential bugs and portability problems.