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

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

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

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

5.77 Boolean type and in C99<br />

C99 introduces <strong>the</strong> native type _Bool. The associated standard header introduces <strong>the</strong><br />

macros bool, true and false <strong>for</strong> Boolean tests. For example:<br />

#include <br />

bool foo(FILE *str)<br />

{<br />

bool err = false;<br />

...<br />

if (!fflush(str))<br />

{<br />

err = true;<br />

}<br />

...<br />

return err;<br />

}<br />

Note<br />

The C99 semantics <strong>for</strong> bool are intended to match those of C++.<br />

5.77.1 See also<br />

Concepts<br />

• New library features of C99 on page 5-79.<br />

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

ID061811<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!