summaryrefslogtreecommitdiff
path: root/static/freebsd/man7/c.7 3.html
diff options
context:
space:
mode:
Diffstat (limited to 'static/freebsd/man7/c.7 3.html')
-rw-r--r--static/freebsd/man7/c.7 3.html363
1 files changed, 363 insertions, 0 deletions
diff --git a/static/freebsd/man7/c.7 3.html b/static/freebsd/man7/c.7 3.html
new file mode 100644
index 00000000..98bbcb70
--- /dev/null
+++ b/static/freebsd/man7/c.7 3.html
@@ -0,0 +1,363 @@
+<table class="head">
+ <tr>
+ <td class="head-ltitle">C(7)</td>
+ <td class="head-vol">Miscellaneous Information Manual</td>
+ <td class="head-rtitle">C(7)</td>
+ </tr>
+</table>
+<div class="manual-text">
+<section class="Sh">
+<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
+<p class="Pp"><code class="Nm">c</code>, <code class="Nm">c78</code>,
+ <code class="Nm">c89</code>, <code class="Nm">c90</code>,
+ <code class="Nm">c95</code>, <code class="Nm">c99</code>,
+ <code class="Nm">c11</code>, <code class="Nm">c17</code>,
+ <code class="Nm">c23</code>, <code class="Nm">c2y</code> &#x2014;
+ <span class="Nd">The C programming language</span></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
+<p class="Pp">C is a general purpose programming language, which has a strong
+ connection with the UNIX operating system and its derivatives, since the
+ vast majority of those systems were written in the C language. The C
+ language contains some basic ideas from the BCPL language through the B
+ language written by Ken Thompson in 1970 for the DEC PDP-7 machines. The
+ development of the UNIX operating system was started on a PDP-7 machine in
+ assembly language, but it made very difficult to port the existing code to
+ other systems.</p>
+<p class="Pp">In 1972 Dennis M. Ritchie worked out the C programming language
+ for further development of the UNIX operating system. The idea was to
+ implement only the C compiler for different platforms, and implement most
+ part of the operating system in the new programming language to simplify the
+ portability between different architectures. It follows that C is very
+ eligible for (but not limited to) writing operating systems and low-level
+ applications.</p>
+<p class="Pp">The C language did not have a specification or standardized
+ version for a long time. It went through a lot of changes and improvements
+ for ages. In 1978, Brian W. Kernighan and Dennis M. Ritchie published the
+ first book about C under the title &quot;The C Programming Language&quot;.
+ We can think of this book as the first specification of the language. This
+ version is often referred as K&amp;R C after the names of the authors.
+ Sometimes it is referred as C78, as well, after the publishing year of the
+ first edition of the book.</p>
+<p class="Pp">It is important to notice, that the instruction set of the
+ language is limited to the most fundamental elements for simplicity.
+ Handling of the standard I/O and such common functions are implemented in
+ the libraries shipped with the compiler. As these functions are also widely
+ used, it was demanded to include into the description what requisites the
+ library should conform to, not just strictly the language itself.
+ Accordingly, the aforementioned standards cover the library elements, as
+ well. The elements of this standard library is still not enough for more
+ complicated tasks. In this case the provided system calls of the given
+ operating system can be used. To not lose the portability by using these
+ system calls, the POSIX (Portable Operating System Interface) standard
+ evolved. It describes what functions should be available to keep
+ portability. Note, that POSIX is not a C standard, but an operating system
+ standard and thus is beyond the scope of this manual. The standards
+ discussed below are all C standards and only cover the C programming
+ language and the accompanying library. All listed improvements for each
+ standard edition are taken from the official standard drafts. For further
+ details, check the publicly available drafts or purchase the published
+ standards &#x2014; from either ISO or IEC resources.</p>
+<p class="Pp">After the publication of the book mentioned before, the American
+ National Standards Institute (ANSI) started to work on standardizing the
+ language, and they announced ANSI X3.159-1989 in 1989. It is usually
+ referred to as ANSI C or C89. The main difference in this standard were the
+ function prototypes, which is a new way of declaring functions. With the
+ old-style function declarations, the compiler was unable to check the sanity
+ of the actual parameters at a function call. The old syntax was highly
+ error-prone because incompatible parameters were hard to detect in the
+ program code and the problem only showed up at run-time.</p>
+<p class="Pp">In 1990, the International Organization for Standardization (ISO)
+ adopted the ANSI standard as ISO/IEC 9899:1990 in 1990. This is also
+ referred to as ISO C or C90. It only contains negligible minor modifications
+ against ANSI C, so the two standards often considered to be fully
+ equivalent. This was a very important milestone in the history of the C
+ language, but the development of the language did not stop.</p>
+<p class="Pp">The ISO C standard was later extended with an amendment as ISO/IEC
+ 9899/AMD1 in 1995. This contained, for example, the wide-character support
+ in <code class="In">&lt;<a class="In">wchar.h</a>&gt;</code> and
+ <code class="In">&lt;<a class="In">wctype.h</a>&gt;</code>, and also
+ restricted character set support via diagraphs and
+ <code class="In">&lt;<a class="In">iso646.h</a>&gt;</code>. This amendment
+ is usually referred to as C95. Two technical corrigenda were also published:
+ Technical Corrigendum 1 as ISO/IEC 9899/COR1 in 1994 and Technical
+ Corrigendum 2 as ISO/IEC 9899/COR2 in 1996. The continuous development and
+ growth made it necessary to work out a new standard, which contains the new
+ features and fixes the known defects and deficiencies of the language. As a
+ result, ISO/IEC 9899:1999 was born in 1999 as the second edition of the
+ standard. Similarly to the other standards, this is informally named after
+ the publication year as C99. The improvements include (but are not limited
+ to) the following:</p>
+<ul class="Bl-bullet Bd-indent">
+ <li>digraphs, trigraphs, and alternative spellings for the operators that use
+ non-ISO646 characters in
+ <code class="In">&lt;<a class="In">iso646.h</a>&gt;</code></li>
+ <li>extended multibyte and wide character library support in
+ <code class="In">&lt;<a class="In">wchar.h</a>&gt;</code> and
+ <code class="In">&lt;<a class="In">wctype.h</a>&gt;</code></li>
+ <li>variable length arrays</li>
+ <li>flexible array members</li>
+ <li>complex (and imaginary) number arithmetic support in
+ <code class="In">&lt;<a class="In">complex.h</a>&gt;</code></li>
+ <li>type-generic math macros in
+ <code class="In">&lt;<a class="In">tgmath.h</a>&gt;</code></li>
+ <li>the long long int type and library functions</li>
+ <li>remove implicit int type</li>
+ <li>universal character names (\u and \U)</li>
+ <li>compound literals</li>
+ <li>remove implicit function declaration</li>
+ <li>BCPL style single-line comments</li>
+ <li>allow mixed declarations and code</li>
+ <li id="vscanf">the
+ <a class="permalink" href="#vscanf"><code class="Fn">vscanf</code></a>()
+ family of functions in
+ <code class="In">&lt;<a class="In">stdio.h</a>&gt;</code> and
+ <code class="In">&lt;<a class="In">wchar.h</a>&gt;</code></li>
+ <li>allow trailing comma in enum declaration</li>
+ <li>inline functions</li>
+ <li id="snprintf">the
+ <a class="permalink" href="#snprintf"><code class="Fn">snprintf</code></a>()
+ family of functions in
+ <code class="In">&lt;<a class="In">stdio.h</a>&gt;</code></li>
+ <li>boolean type and macros in
+ <code class="In">&lt;<a class="In">stdbool.h</a>&gt;</code></li>
+ <li>empty macro arguments</li>
+ <li>_Pragma preprocessing operator</li>
+ <li>__func__ predefined identifier</li>
+ <li>va_copy macro in
+ <code class="In">&lt;<a class="In">stdarg.h</a>&gt;</code></li>
+ <li>additional strftime conversion specifiers</li>
+</ul>
+<p class="Pp">Later in 2011, the third edition of the standard, ISO/IEC
+ 1989:2011, commonly referred to as C11 (formerly C1x), came out and replaced
+ the second edition by ISO/IEC 9899:1999/COR1:2001, ISO/IEC
+ 9899:1999/COR2:2004, and ISO/IEC 9899:1999/COR3:2007. The improvements
+ include (but are not limited to) the following:</p>
+<ul class="Bl-bullet Bd-indent">
+ <li>support for multiple threads of execution and atomic operations in
+ <code class="In">&lt;<a class="In">threads.h</a>&gt;</code> and
+ <code class="In">&lt;<a class="In">stdatomic.h</a>&gt;</code></li>
+ <li>additional floating-point characteristic macros in
+ <code class="In">&lt;<a class="In">float.h</a>&gt;</code></li>
+ <li>querying and specifying alignment of objects in
+ <code class="In">&lt;<a class="In">stdalign.h</a>&gt;</code> and
+ <code class="In">&lt;<a class="In">stdlib.h</a>&gt;</code></li>
+ <li>Unicode character types and functions in
+ <code class="In">&lt;<a class="In">uchar.h</a>&gt;</code></li>
+ <li>type-generic expressions</li>
+ <li>static assertions in
+ <code class="In">&lt;<a class="In">assert.h</a>&gt;</code></li>
+ <li>anonymous structures and unions</li>
+ <li>remove the gets function from
+ <code class="In">&lt;<a class="In">stdio.h</a>&gt;</code></li>
+ <li>add the aligned_alloc, at_quick_exit, and quick_exit functions in
+ <code class="In">&lt;<a class="In">stdlib.h</a>&gt;</code></li>
+</ul>
+<p class="Pp">C11 was later superseded by ISO/IEC 9899:2018, also known as C17
+ which was prepared in 2017 and published in June 2018 as the fourth edition.
+ It incorporates the Technical Corrigendum 1 (ISO/IEC 9899:2011/COR1:2012)
+ which was published in 2012. It addressed defects and deficiencies in C11
+ without introducing new features, only corrections and clarifications.</p>
+<p class="Pp">C23, formally ISO/IEC 9899:2024, is the current standard with
+ significant updates that supersede C17 (ISO/IEC 9899:2018). The
+ standardization effort began in 2016, informally as C2x, with the first WG14
+ meeting in 2019, and was officially published on October 31, 2024. C23 was
+ originally anticipated for an earlier release, but the timeline was extended
+ due to COVID-19 pandemic. With C23, the value of __STDC_VERSION__ has been
+ updated from 201710L to 202311L. Key changes include (but are not limited
+ to) the following:</p>
+<ul class="Bl-bullet Bd-indent">
+ <li>Add null pointer type nullptr_t and the nullptr keyword</li>
+ <li>Add constexpr keyword as a storage-class specifier for objects</li>
+ <li>Redefine the usage of the auto keyword to support type inference while
+ also retaining its previous functionality as a storage-class specifier
+ when used with a type</li>
+ <li id="printf">Add %b binary conversion specifier to the
+ <a class="permalink" href="#printf"><code class="Fn">printf</code></a>()
+ and
+ <a class="permalink" href="#scanf"><code class="Fn" id="scanf">scanf</code></a>()
+ function families</li>
+ <li id="strtol">Add binary conversion support (0b and 0B) to the
+ <a class="permalink" href="#strtol"><code class="Fn">strtol</code></a>()
+ and
+ <a class="permalink" href="#wcstol"><code class="Fn" id="wcstol">wcstol</code></a>()
+ function families</li>
+ <li>Add the #embed directive for binary resource inclusion and __has_embed to
+ check resource availability with preprocessor directives</li>
+ <li>Add the #warning directive for diagnostics</li>
+ <li>Add the #elifdef and #elifndef directives</li>
+ <li>Add the u8 prefix for character literals to represent UTF-8 encoding,
+ compatible with C++17</li>
+ <li>Add the char8_t type for UTF-8 encoded data and update the types of u8
+ character constants and string literals to char8_t</li>
+ <li id="mbrtoc8">Add functions
+ <a class="permalink" href="#mbrtoc8"><code class="Fn">mbrtoc8</code></a>()
+ and
+ <a class="permalink" href="#c8rtomb"><code class="Fn" id="c8rtomb">c8rtomb</code></a>()
+ to convert between narrow multibyte characters and UTF-8 encoding</li>
+ <li>Define all char16_t strings and literals as UTF-16 encoded and char32_t
+ strings and literals as UTF-32 encoded unless specified otherwise</li>
+ <li>Allow storage-class specifiers within compound literals</li>
+ <li>Support the latest IEEE 754 standard, ISO/IEC 60559:2020, with binary and
+ (optional) decimal floating-point arithmetic</li>
+ <li>Add single-argument _Static_assert for compatibility with C++17</li>
+ <li>Add _Decimal32, _Decimal64, _Decimal128 keywords for (optional) decimal
+ floating-point arithmetic</li>
+ <li>Add digit separator ' (the single quote character) for literals</li>
+ <li>Enable specification of the underlying type of an enum</li>
+ <li id="typeof">Standardize the
+ <a class="permalink" href="#typeof"><code class="Fn">typeof</code></a>()
+ operator</li>
+ <li id="memset_explicit">Add
+ <a class="permalink" href="#memset_explicit"><code class="Fn">memset_explicit</code></a>()
+ in <code class="In">&lt;<a class="In">string.h</a>&gt;</code> to securely
+ erase sensitive data regardless of optimizations</li>
+ <li id="memccpy">Add
+ <a class="permalink" href="#memccpy"><code class="Fn">memccpy</code></a>()
+ in <code class="In">&lt;<a class="In">string.h</a>&gt;</code> for
+ efficient string concatenation</li>
+ <li id="memalignment">Add
+ <a class="permalink" href="#memalignment"><code class="Fn">memalignment</code></a>()
+ in <code class="In">&lt;<a class="In">stdlib.h</a>&gt;</code> to determine
+ pointer alignment</li>
+ <li id="strdup">Add
+ <a class="permalink" href="#strdup"><code class="Fn">strdup</code></a>()
+ and
+ <a class="permalink" href="#strndup"><code class="Fn" id="strndup">strndup</code></a>()
+ in <code class="In">&lt;<a class="In">string.h</a>&gt;</code> to allocate
+ string copies</li>
+ <li>Introduce bit utility functions, macros, and types in the new header
+ <code class="In">&lt;<a class="In">stdbit.h</a>&gt;</code></li>
+ <li id="timegm">Add
+ <a class="permalink" href="#timegm"><code class="Fn">timegm</code></a>()
+ in <code class="In">&lt;<a class="In">time.h</a>&gt;</code> for converting
+ time structures to calendar time values</li>
+ <li>Add __has_include for header availability checking via preprocessor
+ directives</li>
+ <li>Add __has_c_attribute to check attribute availability via preprocessor
+ directives</li>
+ <li>Add _BitInt(N) and unsigned _BitInt(N) for bit-precise integers, and
+ BITINT_MAXWIDTH for maximum bit width</li>
+ <li>Elevate true and false to proper keywords (previously macros from
+ <code class="In">&lt;<a class="In">stdbool.h</a>&gt;</code>)</li>
+ <li>Add keywords alignas, alignof, bool, static_assert, thread_local;
+ previously defined keywords remain available as alternative spellings</li>
+ <li>Enable zero initialization with {} (including initialization of VLAs)</li>
+ <li>Introduce C++11 style attributes using [[]], with adding [[deprecated]],
+ [[fallthrough]], [[maybe_unused]], [[nodiscard]], and [[noreturn]]</li>
+ <li>Deprecate _Noreturn, noreturn, header
+ <code class="In">&lt;<a class="In">stdnoreturn.h</a>&gt;</code> features
+ introduced in C11</li>
+ <li>Remove trigraph support</li>
+ <li>Remove K&amp;R function definitions and declarations</li>
+ <li>Remove non-two's-complement representations for signed integers</li>
+</ul>
+<p class="Pp">The next version of the C Standard, informally named C2y, is
+ anticipated to release within the next six years, targeting 2030 at the
+ latest. A charter for C2y is still being drafted and discussed, with several
+ papers under debate from the January 2024 meeting in Strasbourg, France
+ indicating that this new version may address long-standing requests and
+ deficiencies noted by the C community, while preserving its core
+ strengths.</p>
+<p class="Pp">ISO/IEC JTC1/SC22/WG14 committee is responsible for the ISO/IEC
+ 9899, C Standard.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
+ ALSO</a></h1>
+<p class="Pp"><a class="Xr">c89(1)</a>, <a class="Xr">c99(1)</a>,
+ <a class="Xr">cc(1)</a></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="STANDARDS"><a class="permalink" href="#STANDARDS">STANDARDS</a></h1>
+<p class="Pp"><cite class="Rs"><span class="RsA">ANSI</span>,
+ <span class="RsT">X3.159-1989 (aka C89 or ANSI C)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">9899:1990 (aka C90)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">9899:1990/AMD 1:1995, Amendment 1: C Integrity (aka
+ C95)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">9899:1990/COR 1:1994, Technical Corrigendum
+ 1</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">9899:1990/COR 2:1996, Technical Corrigendum
+ 2</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">9899:1999 (aka C99)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">9899:1999/COR 1:2001, Technical Corrigendum
+ 1</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">9899:1999/COR 2:2004, Technical Corrigendum
+ 2</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">9899:1999/COR 3:2007, Technical Corrigendum
+ 3</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">TR 24731-1:2007 (aka bounds-checking
+ interfaces)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">TS 18037:2008 (aka, embedded C)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">TR 24747:2009 (aka mathematical special
+ functions)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">TR 24732:2009 (aka decimal
+ floating-point)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">TR 24731-2:2010 (aka dynamic allocation
+ functions)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">9899:2011 (aka C11)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">9899:2011/COR 1:2012, Technical Corrigendum
+ 1</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">TS 17961:2013 (aka C secure coding
+ rules)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">TS 18861-1:2014 (aka binary
+ floating-point)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">TS 18861-2:2015 (aka decimal
+ floating-point)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">TS 18861-3:2015 (aka interchange and extended
+ types)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">TS 18861-4:2015 (aka supplementary
+ functions)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">TS 17961:2013/COR 1:2016 (aka C secure coding rules
+ TC1)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">TS 18861-5:2016 (aka supplementary
+ attributes)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">9899:2018 (aka C17)</span>.</cite></p>
+<p class="Pp"><cite class="Rs"><span class="RsA">ISO/IEC</span>,
+ <span class="RsT">9899:2024 (aka C23)</span>.</cite></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
+<p class="Pp">This manual page first appeared in <span class="Ux">FreeBSD
+ 9.0</span>.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
+<p class="Pp">This manual page was originally written by <span class="An">Gabor
+ Kovesdan</span>
+ &lt;<a class="Mt" href="mailto:gabor@FreeBSD.org">gabor@FreeBSD.org</a>&gt;.
+ It was updated by <span class="An">Faraz Vahedi</span>
+ &lt;<a class="Mt" href="mailto:kfv@kfv.io">kfv@kfv.io</a>&gt; with
+ information about more recent C standards.</p>
+</section>
+</div>
+<table class="foot">
+ <tr>
+ <td class="foot-date">November 4, 2024</td>
+ <td class="foot-os">FreeBSD 15.0</td>
+ </tr>
+</table>