]>
Commit | Line | Data |
---|---|---|
c63539ff ML |
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 | .. index:: Wall | |
7 | ||
8 | .. _standard-libraries: | |
9 | ||
10 | Standard Libraries | |
11 | ****************** | |
12 | ||
13 | GCC by itself attempts to be a conforming freestanding implementation. | |
14 | See :ref:`standards`, for details of | |
15 | what this means. Beyond the library facilities required of such an | |
16 | implementation, the rest of the C library is supplied by the vendor of | |
17 | the operating system. If that C library doesn't conform to the C | |
18 | standards, then your programs might get warnings (especially when using | |
19 | :option:`-Wall`) that you don't expect. | |
20 | ||
21 | For example, the ``sprintf`` function on SunOS 4.1.3 returns | |
22 | ``char *`` while the C standard says that ``sprintf`` returns an | |
23 | ``int``. The ``fixincludes`` program could make the prototype for | |
24 | this function match the Standard, but that would be wrong, since the | |
25 | function will still return ``char *``. | |
26 | ||
27 | If you need a Standard compliant library, then you need to find one, as | |
28 | GCC does not provide one. The GNU C library (called ``glibc``) | |
29 | provides ISO C, POSIX, BSD, SystemV and X/Open compatibility for | |
30 | GNU/Linux and HURD-based GNU systems; no recent version of it supports | |
31 | other systems, though some very old versions did. Version 2.2 of the | |
32 | GNU C library includes nearly complete C99 support. You could also ask | |
3ed1b4ce | 33 | your operating system vendor if newer libraries are available. |