C Library: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
Solar (talk | contribs)
→‎Versions: fare-well edit. ;-)
m removed extra commas, added one bullet point
Line 5: Line 5:
==Versions==
==Versions==


The C standard describes two versions of the standard library: the, 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 C standard describes two versions of the standard library: the 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>.
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>.
Line 20: Line 20:
===Newlib===
===Newlib===
* The license is unrestricted (not GPL or LGPL), but each file likely has a different copyright notice.
* The license is unrestricted (not GPL or LGPL), but each file likely has a different copyright notice.
* Requires threading, so is more appropriate for a runtime library
* [http://sourceware.org/newlib/ newlib website]
* [http://sourceware.org/newlib/ newlib website]