11.07.2015 Views

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

<strong>Compiler</strong> extensionsThis chapter gives a brief overview of the <strong>MSP430</strong> <strong>IAR</strong> C/<strong>C++</strong> <strong>Compiler</strong>extensions to the ISO/ANSI C standard. All extensions can also be used forthe <strong>C++</strong> programming language. More specifically the chapter describes theavailable C language extensions.<strong>Compiler</strong> extensions overviewThe compiler offers the standard features of ISO/ANSI C as well as a wide set ofextensions, ranging from features specifically tailored for efficient programming in theembedded industry to the relaxation of some minor standards issues.You can find the extensions available as:●●●●C/<strong>C++</strong> language extensionsFor a summary of available language extensions, see C language extensions, page180. For <strong>reference</strong> information about the extended keywords, see the chapterExtended keywords. For information about <strong>C++</strong>, the two levels of support for thelanguage, and <strong>C++</strong> language extensions; see the chapter Using <strong>C++</strong>.Pragma directivesThe #pragma directive is defined by the ISO/ANSI C standard and is a mechanismfor using vendor-specific extensions in a controlled way to make sure that the sourcecode is still portable.The compiler provides a set of predefined pragma directives, which can be used forcontrolling the behavior of the compiler, for example how it allocates memory,whether it allows extended keywords, and whether it outputs warning messages.Most pragma directives are preprocessed, which means that macros are substitutedin a pragma directive. The pragma directives are always enabled in the compiler andmany of them have an equivalent C/<strong>C++</strong> language extensions. For a list of availablepragma directives, see the chapter Pragma directives.Preprocessor extensionsThe preprocessor of the compiler adheres to the ISO/ANSI standard. In addition, thecompiler also makes a number of preprocessor-related extensions available to you.For more information, see the chapter The preprocessor.Intrinsic functionsThe intrinsic functions provide direct access to low-level processor operations andcan be very useful in, for example, time-critical routines. The intrinsic functionscompile into inline code, either as a single instruction or as a short sequence ofPart 2. <strong>Compiler</strong> <strong>reference</strong> 179

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

Saved successfully!

Ooh no, something went wrong!