17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PreProcessor<br />

__time__<br />

Syntax:<br />

Elements:<br />

Purpose:<br />

__TIME__<br />

None<br />

This pre-processor identifier is replaced at compile time with the time of the<br />

compile in the form: "hh:mm:ss"<br />

Examples:<br />

printf("Software was compiled on ");<br />

printf(__TIME__);<br />

Example Files:<br />

Also See:<br />

None<br />

None<br />

#type<br />

Syntax:<br />

Elements:<br />

#TYPE standard-type=size<br />

#TYPE default=area<br />

#TYPE unsigned<br />

#TYPE signed<br />

standard-type is one of the C keywords short, int, long, or default<br />

size is 1,8,16, or 32<br />

area is a memory region defined before the #TYPE using the addressmod directive<br />

Purpose:<br />

By default the compiler treats SHORT as one bit , INT as 8 bits, and LONG as 16 bits.<br />

The traditional C convention is to have INT defined as the most efficient size for the<br />

target processor. This is why it is 8 bits on the PIC ® . In order to help with code<br />

compatibility a #TYPE directive may be used to allow these types to be changed.<br />

#TYPE can redefine these keywords.<br />

Note that the commas are optional. Since #TYPE may render some sizes inaccessible<br />

(like a one bit int in the above) four keywords representing the four ints may always be<br />

used: INT1, INT8, INT16, and INT32. Be warned <strong>CCS</strong> example programs and include<br />

files may not work right if you use #TYPE in your program.<br />

This directive may also be used to change the default RAM area used for variable<br />

storage. This is done by specifying default=area where area is a addressmod address<br />

space.<br />

When linking multiple compilation units be aware this directive only applies to the<br />

131

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

Saved successfully!

Ooh no, something went wrong!