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.

C Language FeaturesPreprocessingTable 3.11: Pragma directivesDirective Meaning Exampleinline Specify function as inline #pragma inline(fabs)jisEnable JIS character handling in #pragma jisstringsnojis Disable JIS character handling (default)#pragma nojispack Specify structure packing #pragma pack 1printf_check Enable printf-style format stringchecking#pragmaprintf_check(printf) constpsect Rename compiler-defined psect #pragma psect text=mytextregsused Specify registers which are used in #pragma regsused r4an interruptswitch Specify code generation for switchstatements#pragma switch direct3.12.3 Pragma DirectivesThere are certain compile-time directives that can be used to modify the behaviour of the compiler.These are implemented through the use of the ANSI standard #pragma facility. The format of apragma is:#pragma keyword optionswhere keyword is one of a set of keywords, some of which are followed by certain options. Alist of the keywords is given in Table 3.11. Those keywords not discussed elsewhere are detailedbelow.3.12.3.1 The #pragma inline DirectiveSome of the standard C library functions only contain a small amount of code. Because the code issmall, often it would be more efficient to directly include (inline) the library function’s code ratherthan calling it and linking in the function.The #pragma inline directive provides a mechanism for doing this. The compiler can only dothis for library routines which it recognizes and currently HI-TECH <strong>dsPIC</strong>C only supports inliningof the fabs() library routine.57

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

Saved successfully!

Ooh no, something went wrong!