C Library: Difference between revisions

Jump to navigation Jump to search
Improved the Types section (and changed its name to the more appropriate Versions) as there were complaints on the discussion page.
[unchecked revision][unchecked revision]
(Added details, fixed PDClib url, fixed broken urls.)
(Improved the Types section (and changed its name to the more appropriate Versions) as there were complaints on the discussion page.)
Line 3:
The ''C standard library'' provides basic functionality such as string manipulation, basic I/O, and memory allocation. Whether you're writing a kernel in C or you plan on supporting existing C programs, you'll want to use it.
 
==TypesVersions==
 
The C standard describes two versions of the C standard library.: Thethe, complete, hosted library and the freestanding one, providing only a subset of the hosted library that doesn't need to interact with the environment. System software should typically use the former, while applications should have the latter available.
 
The <tt>__STDC_HOSTED__</tt> macro expands to <tt>1</tt> on hosted implementations, or <tt>0</tt> on freestanding ones. The freestanding headers are: <tt>&lt;float.h&gt;</tt>, <tt>&lt;iso646.h&gt;</tt>, <tt>&lt;limits.h&gt;</tt>, <tt>&lt;stdalign.h&gt;</tt>, <tt>&lt;stdarg.h&gt;</tt>, <tt>&lt;stdbool.h&gt;</tt>, <tt>&lt;stddef.h&gt;</tt>, <tt>&lt;stdint.h&gt;</tt>, and <tt>&lt;stdnoreturn.h&gt;</tt>. Note that not all their functionality is available in the freestanding mode.
 
GCC defaults to a hosted implementation, but can switch to a freestanding one with the <tt>-ffreestanding</tt> argument.
 
==Implementations==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu