12.07.2015 Views

MPLAB C32 C COMPILER USER'S GUIDE

MPLAB C32 C COMPILER USER'S GUIDE

MPLAB C32 C COMPILER USER'S GUIDE

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>MPLAB</strong> ® <strong>C32</strong> C Compiler User’s Guideat_vectorPlace the body of the function at the indicated exception vector address. See Chapter3. “Interrupts” and Section 3.5 “Exception Handlers”.nakedGenerate no prologue or epilogue code for the function.section (“name”)Place the function into the named section.For example,void __attribute__ ((section (“.wilma”))) baz () {return;}Function baz will be placed in section .wilma.The -ffunction-sections command line option has no effect on functions definedwith a section attribute.unique_sectionPlace the function in a uniquely named section, just as if -ffunction-sections hadbeen specified. If the function also has a section attribute, use that section name asthe prefix for generating the unique section name.For example,void __attribute__ ((section (“.fred”), unique_section) foo (void) {return;}Function foo will be placed in section .fred.foo.noreturnIndicate to the compiler that the function will never return. In some situations, this canallow the compiler to generate more efficient code in the calling function sinceoptimizations can be performed without regard to behavior if the function ever didreturn. Functions declared as noreturn should always have a return type of void.noinlineThe function will never be considered for inlining.pureIf a function has no side effects other than its return value, and the return value isdependent only on parameters and/or (nonvolatile) global variables, the compiler canperform more aggressive optimizations around invocations of that function. Suchfunctions can be indicated with the pure attribute.constIf a pure function determines its return value exclusively from its parameters (i.e., doesnot examine any global variables), it may be declared const, allowing for even moreaggressive optimization. Note that a function which de-references a pointer argumentis not const since the pointer de-reference uses a value which is not an parameter,even though the pointer itself is a parameter.format (type, format_index, first_to_check)The format attribute indicates that the function takes a printf, scanf, strftime,or strfmon style format string and arguments and that the compiler should type checkthose arguments against the format string, just as it does for the standard libraryfunctions.The type parameter is one of printf, scanf, strftime or strfmon (optionally withsurrounding double underscores, e.g., __printf__) and determines how the formatstring will be interpreted.The format_index parameter specifies which function parameter is the format string.Function parameters are numbered from the left-most parameter, starting from 1.DS51686A-page 12© 2007 Microchip Technology Inc.

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

Saved successfully!

Ooh no, something went wrong!