Messaging Overview

A centralized messaging system is used by most applications to report on the validity of your program and the compilation process.

Note: The Clang front end, used when compiling for C99 projects, currently bypasses this system and is not controlled by the features described here. The front end is responsible for messages such as syntax errors in your C source code; however, all other applications always use the messaging system described here.

Messages are referenced by a unique number. The messaging system takes the message number requested by the application that needs to convey the information and determines the corresponding message type and string from one of several Message Description Files (MDF), stored in the pic/dat directory of the compiler’s installation directory. Some applications also include a built-in copy of this information should a MDF not be specified on the command line or the file cannot be found.

The user is able to set a threshold for being notified of message importance, so that only messages the user considers significant are displayed. In addition, messages with a particular number can be disabled. In some instances, a pragma can also be used to disable a particular message number within specific lines of code. These methods are explained in Disabling Messages.

As well as the actual message string produced by the compiler, there are several other pieces of information that can be displayed when the message is triggered, such as the message number, the line number of the code that triggered the message, the name of the file that contains the offending code, and the application that issued the message, etc.

If a message is an error, an internal counter is incremented. After a specific number of errors has been reached, compilation of the current module will cease. The default number of errors that cause this termination can be adjusted by using the -fmax-errors option (see Max Errors Option). This counter is reset for each internal compiler application, thus specifying a maximum of five errors will allow up to five errors from the parser, five from the code generator, five from the linker, five from the driver, etc.

Although the information in the MDF can be modified with any text editor, this is not recommended. Message behavior should only be altered using the options and pragmas described in the following sections.