]> git.ipfire.org Git - thirdparty/gcc.git/blob
05cc6f2aefc0f04b11d6f5e323a578d4f693232e
[thirdparty/gcc.git] /
1 ..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6 .. _headers:
7
8 Headers Installed by GCC
9 ^^^^^^^^^^^^^^^^^^^^^^^^
10
11 In general, GCC expects the system C library to provide most of the
12 headers to be used with it. However, GCC will fix those headers if
13 necessary to make them work with GCC, and will install some headers
14 required of freestanding implementations. These headers are installed
15 in :samp:`{libsubdir}/include`. Headers for non-C runtime
16 libraries are also installed by GCC; these are not documented here.
17
18 .. todo:: document them somewhere
19
20 Several of the headers GCC installs are in the :samp:`ginclude`
21 directory. These headers, :samp:`iso646.h`,
22 :samp:`stdarg.h`, :samp:`stdbool.h`, and :samp:`stddef.h`,
23 are installed in :samp:`{libsubdir}/include`,
24 unless the target Makefile fragment (see :ref:`target-fragment`)
25 overrides this by setting ``USER_H``.
26
27 In addition to these headers and those generated by fixing system
28 headers to work with GCC, some other headers may also be installed in
29 :samp:`{libsubdir}/include`. :samp:`config.gcc` may set
30 ``extra_headers`` ; this specifies additional headers under
31 :samp:`config` to be installed on some systems.
32
33 GCC installs its own version of ``<float.h>``, from :samp:`ginclude/float.h`.
34 This is done to cope with command-line options that change the
35 representation of floating point numbers.
36
37 GCC also installs its own version of ``<limits.h>`` ; this is generated
38 from :samp:`glimits.h`, together with :samp:`limitx.h` and
39 :samp:`limity.h` if the system also has its own version of
40 ``<limits.h>``. (GCC provides its own header because it is
41 required of ISO C freestanding implementations, but needs to include
42 the system header from its own header as well because other standards
43 such as POSIX specify additional values to be defined in
44 ``<limits.h>``.) The system's ``<limits.h>`` header is used via
45 :samp:`{libsubdir}/include/syslimits.h`, which is copied from
46 :samp:`gsyslimits.h` if it does not need fixing to work with GCC; if it
47 needs fixing, :samp:`syslimits.h` is the fixed copy.
48
49 GCC can also install ``<tgmath.h>``. It will do this when
50 :samp:`config.gcc` sets ``use_gcc_tgmath`` to ``yes``.