3.23 Precompiled Header (PCH) file processing and the header stop point

The PCH file contains a snapshot of all the code that precedes a header stop point.

Note

Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05 onwards on all platforms. Note that ARM Compiler on Windows 8 never supported PCH files.
Typically, the header stop point is the first token in the primary source file that does not belong to a preprocessing directive. In the following example, the header stop point is int and the PCH file contains a snapshot that reflects the inclusion of xxx.h and yyy.h:
#include "xxx.h"
#include "yyy.h"
int i;
You can manually specify the header stop point with #pragma hdrstop. If you use this pragma, it must appear before the first token that does not belong to a preprocessing directive. In this example, it must be placed before int, as follows:
#include "xxx.h"
#include "yyy.h"
#pragma hdrstop
int i;
If a conditional directive block (#if, #ifdef, or #ifndef) encloses the first non-preprocessor token or #pragma hdrstop, the header stop point is the outermost enclosing conditional directive.
For example:
#include "xxx.h"
#ifndef YYY_H
#define YYY_H 1
#include "yyy.h"
#endif
#if TEST /* Header stop point lies immediately before #if TEST */
int i;
#endif
In this example, the first token that does not belong to a preprocessing directive is int, but the header stop point is the start of the #if block containing it. The PCH file reflects the inclusion of xxx.h and, conditionally, the definition of YYY_H and inclusion of yyy.h. It does not contain the state produced by #if TEST.
Related concepts
3.22 Automatic Precompiled Header (PCH) file processing
3.21 Precompiled Header (PCH) files
3.24 Precompiled Header (PCH) file creation requirements
3.25 Compilation with multiple Precompiled Header (PCH) files
3.26 Obsolete Precompiled Header (PCH) files
3.27 Manually specifying the filename and location of a Precompiled Header (PCH) file
3.28 Selectively applying Precompiled Header (PCH) file processing
3.29 Suppressing Precompiled Header (PCH) file processing
3.30 Message output during Precompiled Header (PCH) processing
3.31 Performance issues with Precompiled Header (PCH) files
Related reference
7.129 --pch
7.130 --pch_dir=dir
9.83 #pragma hdrstop
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.