Compiler Predefined Macros

The C-language ANSI standard requires the Compiler to predefine some macros. The Compiler provides the predefined macros listed in the following table.

Table 1. Macros Defined by the Compiler
Macro Description
__LINE__ Line number in the current source file
__FILE__ Name of the source file where it appears
__DATE__ The date of compilation as a string
__TIME__ The time of compilation as a string
__STDC__ Set to 1 if the -Ansi: Strict ANSI compiler option is given. Otherwise, accept additional keywords (not ANSI standard).

The following tables lists all Compiler defines with their associated names and options.

Note: If these macros have no value, the Compiler treats them as if they had been defined as shown: #define __HIWARE__

It is also possible to log all predefined Compiler defines to a file using the -Ldf: Log Predefined Defines to File compiler option.

This chapter covers the following topics: