Keil Logo Arm Logo

Technical Support

On-Line Manuals

Compiler User Guide

Conventions and Feedback Overview of the Compiler Getting Started with the Compiler Compiler Features Compiler intrinsics Performance benefits of compiler intrinsics ARM assembler instruction intrinsics supported by Generic intrinsics supported by the compiler Compiler intrinsics for controlling IRQ and FIQ in Compiler intrinsics for inserting optimization bar Compiler intrinsics for inserting native instructi Compiler intrinsics for Digital Signal Processing European Telecommunications Standards Institute (E Compiler support for European Telecommunications S Overflow and carry status flags for C and C++ code Texas Instruments (TI) C55x intrinsics for optimiz Compiler support for accessing registers using nam Pragmas recognized by the compiler Compiler and processor support for bit-banding Compiler type attribute, __attribute__((bitband)) --bitband compiler command-line option How the compiler handles bit-band objects placed o Compiler support for thread-local storage Compiler eight-byte alignment features Using compiler and linker support for symbol versi PreCompiled Header (PCH) files Automatic PreCompiled Header (PCH) file processing PreCompiled Header (PCH) file processing and the h PreCompiled Header (PCH) file creation requirement Compilation with multiple PreCompiled Header (PCH) Obsolete PreCompiled Header (PCH) files Manually specifying the filename and location of a Selectively applying PreCompiled Header (PCH) file Suppressing PreCompiled Header (PCH) file processi Message output during PreCompiled Header (PCH) pro Performance issues with PreCompiled Header (PCH) f Default compiler options that are affected by opti Compiler Coding Practices Compiler Diagnostic Messages Using the Inline and Embedded Assemblers of the AR

Compiler User Guide

PreCompiled Header (PCH) file creation requirements

PreCompiled Header (PCH) file creation requirements

A PCH file is produced only if the header stop point and the code preceding it, mainly the header files, meet the following requirements:

  • The header stop point must appear at file scope. It must not be within an unclosed scope established by a header file. For example, a PCH file is not created in this case:

    // xxx.h
    class A
    {
        // xxx.c
        #include "xxx.h"
        int i;
    }; 
    
  • The header stop point must not be inside a declaration that is started within a header file. Also, in C++, it must not be part of a declaration list of a linkage specification. For example, in the following case the header stop point is int, but because it is not the start of a new declaration, no PCH file is created:

    // yyy.h
    static
    // yyy.c
    #include "yyy.h"
    int i; 
    
  • The header stop point must not be inside a #if block or a #define that is started within a header file.

  • The processing that precedes the header stop point must not have produced any errors.

    Note

    Warnings and other diagnostics are not reproduced when the PCH file is reused.

  • No references to predefined macros __DATE__ or __TIME__ must appear.

  • No instances of the #line preprocessing directive must appear.

  • #pragma no_pch must not appear.

  • The code preceding the header stop point must have introduced a sufficient number of declarations to justify the overhead associated with precompiled headers.

Copyright © 2007-2008, 2011-2012 ARM. All rights reserved.ARM DUI 0375D
Non-ConfidentialID062912

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.