17.05.2015 Views

TMS34010 C Compiler - Al Kossow's Bitsavers

TMS34010 C Compiler - Al Kossow's Bitsavers

TMS34010 C Compiler - Al Kossow's Bitsavers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Compiler</strong> Operation - Preprocessor Description<br />

-dname[=def] defines name as if it were #defined in a C source<br />

file (as in #def ine name def). You can use name in #if<br />

and #ifdef statements without explicitly defining it in the<br />

C source. The =def is optional; if you don't use it, name<br />

has a value of 1. You can use this option multiple times<br />

to define several names; be sure to separate mUltiple -d<br />

options with spaces.<br />

-idir adds dir to the list of directories to be searched for<br />

#include files. (See Section 3.1.3, page 3-4.)<br />

-p prevents the preprocessor from producing line number<br />

and file information.<br />

-q is the "quiet" option; it suppresses the banner and status<br />

information.<br />

Note that options can appear anywhere on the command line.<br />

3.1.2 General Information<br />

• This preprocessor is the same preprocessor that is described in Kernighan<br />

and Ritchie; additional information can be found in that book. This<br />

preprocessor supports the same preprocessor directives that are described<br />

in Kernighan and Ritchie (Appendix B summarizes these directives).<br />

<strong>Al</strong>l preprocessor directives begin with the character #, which<br />

must appear in column 1 of the source statement. Any number of blanks<br />

and tabs may appear between the # sign and the directive name.<br />

• The C preprocessor maintains and recognizes five predefined macro<br />

names:<br />

__ LINE _ _<br />

__ FILE _ _<br />

__ DATE _ _<br />

__ TIME _ _<br />

-gspc<br />

represents the current line number (maintained as a decimal<br />

integer).<br />

represents the current filename (maintained as a C string).<br />

represents the date that the module was compiled<br />

(maintained as a C string).<br />

represents the time that this module was compiled<br />

(maintained as a C string).<br />

identifies the compiler as the TMS3401 0 C compiler; this<br />

symbol is defined as the constant 1.<br />

You can use these names in the same manner as any other defined name.<br />

For example,<br />

printf ("%s %s", __ TIME __ , __ DATE __ ) ;<br />

would translate into a line such as:<br />

printf(%s %s", "Jan 14 1988", "13:58:17"};<br />

• The preprocessor produces self-explanatory error messages. The line<br />

number and the filename where the error occurred are printed along with<br />

a diagnostic message.<br />

3-3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!