13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Tool OptionsC compiler option: --align-compositesMenu entry1. Select C/C++ Compiler » Code Generation.2. Select the Alignment <strong>for</strong> composite types: Natural alignment or Optimal alignment.Command line syntax--align-composites=alignmentYou can specify the following alignments:noNatural alignment (default)Optimal alignmentDescriptionWith this option you can set the alignment <strong>for</strong> composite types (structs, unions and arrays).Natural alignment (n) uses the natural alignment of the most-aligned member of the composite type.Optimal alignment (o) sets the alignment to 8, 16, or 32 bits depending on the size of the composite type.ExampleConsider the following structure of three chars.struct s{char a;char b;char c;} s_var;With natural alignment this results in a size of s_var of three bytes.s_var .type object.size s_var,3.ds 3With --align-composites=o, s_var is padded with one extra byte, so that the contents of the struct isaligned at 4 bytes.s_var .type object.size s_var,4.ds 4333

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

Saved successfully!

Ooh no, something went wrong!