From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- libstdc++-v3/doc/html/manual/using_headers.html | 104 ++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 libstdc++-v3/doc/html/manual/using_headers.html (limited to 'libstdc++-v3/doc/html/manual/using_headers.html') diff --git a/libstdc++-v3/doc/html/manual/using_headers.html b/libstdc++-v3/doc/html/manual/using_headers.html new file mode 100644 index 000000000..fde253e36 --- /dev/null +++ b/libstdc++-v3/doc/html/manual/using_headers.html @@ -0,0 +1,104 @@ + + +Headers

+ The C++ standard specifies the entire set of header files that + must be available to all hosted implementations. Actually, the + word "files" is a misnomer, since the contents of the + headers don't necessarily have to be in any kind of external + file. The only rule is that when one #include's a + header, the contents of that header become available, no matter + how. +

+ That said, in practice files are used. +

+ There are two main types of include files: header files related + to a specific version of the ISO C++ standard (called Standard + Headers), and all others (TR1, C++ ABI, and Extensions). +

+ Two dialects of standard headers are supported, corresponding to + the 1998 standard as updated for 2003, and the draft of the + upcoming 200x standard. +

+ C++98/03 include files. These are available in the default compilation mode, i.e. -std=c++98 or -std=gnu++98. +



+C++0x include files. These are only available in C++0x compilation +mode, i.e. -std=c++0x or -std=gnu++0x. +



+ In addition, TR1 includes as: +



Decimal floating-point arithmetic is available if the C++ +compiler supports scalar decimal floating-point types defined via +__attribute__((mode(SD|DD|LD))). +


+ Also included are files for the C++ ABI interface: +


+ And a large variety of extensions. +





There are three base header files that are provided. They can be +used to precompile the standard headers and extensions into binary +files that may the be used to speed compiles that use these headers. +

How to construct a .gch file from one of these base header files.

First, find the include directory for the compiler. One way to do +this is:

+g++ -v hello.cc
+
+#include <...> search starts here:
+ /mnt/share/bld/H-x86-gcc.20071201/include/c++/4.3.0
+...
+End of search list.
+

Then, create a precompiled header file with the same flags that +will be used to compile other projects.

+g++ -Winvalid-pch -x c++-header -g -O2 -o ./stdc++.h.gch /mnt/share/bld/H-x86-gcc.20071201/include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/stdc++.h
+

The resulting file will be quite large: the current size is around +thirty megabytes.

How to use the resulting file.

+g++ -I. -include stdc++.h  -H -g -O2 hello.cc
+

Verification that the PCH file is being used is easy:

+g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
+! ./stdc++.h.gch
+. /mnt/share/bld/H-x86-gcc.20071201/include/c++/4.3.0/iostream
+. /mnt/share/bld/H-x86-gcc.20071201include/c++/4.3.0/string
+

The exclamation point to the left of the stdc++.h.gch listing means that the generated PCH file was used, and thus the

Detailed information about creating precompiled header files can be found in the GCC documentation. +

-- cgit v1.2.3