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> Features<br />

4.24 PreCompiled Header (PCH) file creation requirements<br />

A PCH file is produced only if <strong>the</strong> header stop point and <strong>the</strong> code preceding it, mainly <strong>the</strong> header<br />

files, meet <strong>the</strong> following requirements:<br />

• The header stop point must appear at file scope. It must not be within an unclosed scope<br />

established by a header file. For example, a PCH file is not created in this case:<br />

// xxx.h<br />

class A<br />

{<br />

// xxx.c<br />

#include "xxx.h"<br />

int i;<br />

};<br />

• The header stop point must not be inside a declaration that is started within a header file.<br />

Also, in C++, it must not be part of a declaration list of a linkage specification. For<br />

example, in <strong>the</strong> following case <strong>the</strong> header stop point is int, but because it is not <strong>the</strong> start<br />

of a new declaration, no PCH file is created:<br />

// yyy.h<br />

static<br />

// yyy.c<br />

#include "yyy.h"<br />

int i;<br />

• The header stop point must not be inside a #if block or a #define that is started within a<br />

header file.<br />

• The processing that precedes <strong>the</strong> header stop point must not have produced any errors.<br />

Note<br />

Warnings and o<strong>the</strong>r diagnostics are not reproduced when <strong>the</strong> PCH file is reused.<br />

• No references to predefined macros __DATE__ or __TIME__ must appear.<br />

• No instances of <strong>the</strong> #line preprocessing directive must appear.<br />

• #pragma no_pch must not appear.<br />

• The code preceding <strong>the</strong> header stop point must have introduced a sufficient number of<br />

declarations to justify <strong>the</strong> overhead associated with precompiled headers.<br />

4.24.1 See also<br />

Tasks<br />

• Selectively applying PreCompiled Header (PCH) file processing on page 4-37<br />

• Suppressing PreCompiled Header (PCH) file processing on page 4-38.<br />

Concepts<br />

• PreCompiled Header (PCH) files on page 4-29<br />

• Automatic PreCompiled Header (PCH) file processing on page 4-30<br />

• PreCompiled Header (PCH) file processing and <strong>the</strong> header stop point on page 4-31<br />

• PreCompiled Header (PCH) file creation requirements<br />

• Per<strong>for</strong>mance issues with PreCompiled Header (PCH) files on page 4-40.<br />

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

ID061811<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!