11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

PreprocessingC Language Features3.12.3.2 The #pragma jis and nojis DirectivesIf your code includes strings with two-byte characters in the JIS encoding for Japanese and other nationalcharacters, the #pragma jis directive will enable proper handling of these characters, specificallynot interpreting a backslash, \, character when it appears as the second half of a two bytecharacter. The nojis directive disables this special handling. JIS character handling is disabled bydefault.3.12.3.3 The #pragma pack DirectiveSome MCUs requires word accesses to be aligned on word boundaries. Consequently the compilerwill align all word or larger quantities onto a word boundary, including structure members. This canlead to “holes” in structures, where a member has been aligned onto the next word boundary.This behaviour can be altered with this directive. Use of the directive #pragma pack 1 willprevent any padding or alignment within structures. Use this directive with caution - in general ifyou must access data that is not aligned on a word boundary you should do so by extracting individualbytes and re-assembling the data. This will result in portable code. Note that this directive must notappear before any system header file, as these must be consistent with the libraries supplied.•<strong>dsPIC</strong>s can only perform byte accesses to memory and so do not require any alignmentof memory objects. This pragma will have no effect when used.3.12.3.4 The #pragma printf_check DirectiveCertain library functions accept a format string followed by a variable number of arguments in themanner of printf(). Although the format string is interpreted at runtime, it can be compile-timechecked for consistency with the remaining arguments.This directive enables this checking for the named function, e.g. the system header file includes the directive #pragma printf_check(printf) const to enable this checking for printf().You may also use this for any user-defined function that accepts printf-style format strings. Thequalifier following the function name is to allow automatic conversion of pointers in variable argumentlists. The above example would cast any pointers to strings in RAM to be pointers of the type(const char *)•Note that the warning level must be set to -1 or below for this option to have any visibleeffect. See Section 2.4.48.58

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

Saved successfully!

Ooh no, something went wrong!