29.10.2014 Views

ARM Compiler toolchain v4.1 for µVision Using the Compiler

ARM Compiler toolchain v4.1 for µVision Using the Compiler

ARM Compiler toolchain v4.1 for µVision Using the Compiler

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

<strong>Compiler</strong> Coding Practices<br />

5.73 _Pragma preprocessing operator in C99<br />

C90 does not permit a #pragma directive to be produced as <strong>the</strong> result of a macro expansion.<br />

However, <strong>the</strong> C99 _Pragma operator enables you to embed a preprocessor macro in a pragma<br />

directive, and _Pragma is permitted in C90 if --strict is not specified. For example:<br />

# define RWDATA(X) PRAGMA(arm section rwdata=#X)<br />

# define PRAGMA(X) _Pragma(#X)<br />

RWDATA(foo) // same as #pragma arm section rwdata="foo"<br />

int y = 1; // y is placed in section "foo"<br />

5.73.1 See also<br />

Concepts<br />

• New language features of C99 on page 5-77.<br />

<strong>ARM</strong> DUI 0375C Copyright © 2007-2008, 2011 <strong>ARM</strong>. All rights reserved. 5-91<br />

ID061811<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!