Diagnostics
This section describes the format of the diagnostic messages and explains how diagnostic messages are divided into different levels of severity.
Message format for the compiler
All diagnostic messages are issued as complete, self-explanatory messages. A typical diagnostic message from the compiler is produced in the form:
filename, linenumberlevel[tag]:message
with these elements:
| The name of the source file in which the issue was encountered |
| The line number at which the compiler detected the issue |
| The level of seriousness of the issue |
| A unique tag that identifies the diagnostic message |
| An explanation, possibly several lines long |
Diagnostic messages are displayed on the screen, as well as printed in the optional list file.
Use the option ‑‑diagnostics_tables to list all possible compiler diagnostic messages.
Message format for the linker
All diagnostic messages are issued as complete, self-explanatory messages. A typical diagnostic message from ILINK is produced in the form:
level[tag]:message
with these elements:
| The level of seriousness of the issue |
| A unique tag that identifies the diagnostic message |
| An explanation, possibly several lines long |
Diagnostic messages are displayed on the screen and printed in the optional map file.
Use the option ‑‑diagnostics_tables to list all possible linker diagnostic messages.
Severity levels
The diagnostic messages are divided into different levels of severity:
Remark
A diagnostic message that is produced when the compileror linker finds a construct that can possibly lead to erroneous behavior in the generated code. Remarks are by default not issued, but can be enabled, see ‑‑remarks.
Warning
A diagnostic message that is produced when the compiler or linker finds a potential problem which is of concern, but which does not prevent completion of the compilation or linking. Warnings can be disabled by use of the command line option ‑‑no_warnings.
Error
A diagnostic message that is produced when the compiler or linker finds a serious error. An error will produce a non-zero exit code.
Fatal error
A diagnostic message produced when the compiler or linker finds a condition that not only prevents code generation, but also makes further processing pointless. After the message is issued, compilation or linking terminates. A fatal error will produce a non-zero exit code.
Setting the severity level
The diagnostic messages can be suppressed or the severity level can be changed for all diagnostics messages, except for fatal errors and some of the regular errors.
For information about the compiler options that are available for setting severity levels, see Compiler options.
For information about the pragma directives that are available for setting severity levels for the compiler, see Pragma directives.
Internal error
An internal error is a diagnostic message that signals that there was a serious and unexpected failure due to a fault in the compiler or linker. It is produced using this form:
Internal error: messagewhere message is an explanatory message. If internal errors occur, they should be reported to your software distributor or IAR Technical Support. Include enough information to reproduce the problem, typically:
The product name
The version number of the compiler or linker, which can be seen in the header of the list or map files generated by the compiler or linker, respectively
Your license number
The exact internal error message text
The files involved of the application that generated the internal error
A list of the options that were used when the internal error occurred.
Error return codes
The compiler and linker return status information to the operating system that can be tested in a batch file.
These command line error codes are supported: