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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Pragma directivesIn this example, the structure FirstPacked is packed and has the following memorylayout:alphabeta1 byte 2 bytesExample 3This example declares a new structure, Second, that contains the structureFirstPacked declared in the previous example. The declaration of Second is notplaced inside a #pragma pack block:struct Second{struct FirstPacked first;short gamma;};The following memory layout is used:first.alphafirst.betagamma1 byte 2 bytes 1 byte 2 bytesNote that the structure FirstPacked will use the memory layout, size, and alignmentdescribed in Example 2. The alignment of the member gamma is 2, which means thatalignment of the structure Second will become 2 and one pad byte will be added.requiredSyntax#pragma required=symbolParameterssymbolAny statically linked function or variable.DescriptionUse this pragma directive to ensure that a symbol which is needed by a second symbolis included in the linked output. The directive must be placed immediately before thesecond symbol.Use the directive if the requirement for a symbol is not otherwise visible in theapplication, for example if a variable is only <strong>reference</strong>d indirectly through the segmentit resides in.Part 2. <strong>Compiler</strong> <strong>reference</strong>211

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

Saved successfully!

Ooh no, something went wrong!