xref: /freebsd/share/man/man7/c.7 (revision 930654318ecee172e4fc1ce57f21b4fb7b12603e)
1136f6b6cSFaraz Vahedi.\" Copyright (C) 2007, 2010 Gabor Kovesdan. All rights reserved.
2136f6b6cSFaraz Vahedi.\" Copyright (C) 2021 Faraz Vahedi <kfv@kfv.io>
3136f6b6cSFaraz Vahedi.\"
4136f6b6cSFaraz Vahedi.\" Redistribution and use in source and binary forms, with or without
5136f6b6cSFaraz Vahedi.\" modification, are permitted provided that the following conditions
6136f6b6cSFaraz Vahedi.\" are met:
7136f6b6cSFaraz Vahedi.\" 1. Redistributions of source code must retain the above copyright
8136f6b6cSFaraz Vahedi.\"    notice, this list of conditions and the following disclaimer.
9136f6b6cSFaraz Vahedi.\" 2. Redistributions in binary form must reproduce the above copyright
10136f6b6cSFaraz Vahedi.\"    notice, this list of conditions and the following disclaimer in the
11136f6b6cSFaraz Vahedi.\"    documentation and/or other materials provided with the distribution.
12136f6b6cSFaraz Vahedi.\"
13136f6b6cSFaraz Vahedi.\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14136f6b6cSFaraz Vahedi.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15136f6b6cSFaraz Vahedi.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16136f6b6cSFaraz Vahedi.\" ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
17136f6b6cSFaraz Vahedi.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18136f6b6cSFaraz Vahedi.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19136f6b6cSFaraz Vahedi.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20136f6b6cSFaraz Vahedi.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21136f6b6cSFaraz Vahedi.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22136f6b6cSFaraz Vahedi.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23136f6b6cSFaraz Vahedi.\" SUCH DAMAGE.
24136f6b6cSFaraz Vahedi.\"
25*93065431SFaraz Vahedi.Dd November 4, 2024
26136f6b6cSFaraz Vahedi.Dt C 7
27136f6b6cSFaraz Vahedi.Os
28136f6b6cSFaraz Vahedi.Sh NAME
29136f6b6cSFaraz Vahedi.Nm c ,
30136f6b6cSFaraz Vahedi.Nm c78 ,
31136f6b6cSFaraz Vahedi.Nm c89 ,
32136f6b6cSFaraz Vahedi.Nm c90 ,
33136f6b6cSFaraz Vahedi.Nm c95 ,
34136f6b6cSFaraz Vahedi.Nm c99 ,
35136f6b6cSFaraz Vahedi.Nm c11 ,
36136f6b6cSFaraz Vahedi.Nm c17 ,
37*93065431SFaraz Vahedi.Nm c23 ,
38*93065431SFaraz Vahedi.Nm c2y
39136f6b6cSFaraz Vahedi.Nd The C programming language
40136f6b6cSFaraz Vahedi.Sh DESCRIPTION
41136f6b6cSFaraz VahediC is a general purpose programming language, which has a strong connection
42136f6b6cSFaraz Vahediwith the UNIX operating system and its derivatives, since the vast
43136f6b6cSFaraz Vahedimajority of those systems were written in the C language.
44136f6b6cSFaraz VahediThe C language contains some basic ideas from the BCPL language through
45136f6b6cSFaraz Vahedithe B language written by Ken Thompson in 1970 for the DEC PDP-7 machines.
46136f6b6cSFaraz VahediThe development of the UNIX operating system was started on a PDP-7
47136f6b6cSFaraz Vahedimachine in assembly language, but it made very difficult to port the existing
48136f6b6cSFaraz Vahedicode to other systems.
49136f6b6cSFaraz Vahedi.Pp
50136f6b6cSFaraz VahediIn 1972 Dennis M. Ritchie worked out the C programming language for
51136f6b6cSFaraz Vahedifurther development of the UNIX operating system.
52136f6b6cSFaraz VahediThe idea was to implement only the C compiler for different
53136f6b6cSFaraz Vahediplatforms, and implement most part of the operating system
54136f6b6cSFaraz Vahediin the new programming language to simplify the portability between
55136f6b6cSFaraz Vahedidifferent architectures.
56136f6b6cSFaraz VahediIt follows that C is very eligible for (but not limited to) writing
57136f6b6cSFaraz Vahedioperating systems and low-level applications.
58136f6b6cSFaraz Vahedi.Pp
59136f6b6cSFaraz VahediThe C language did not have a specification or standardized version for
60136f6b6cSFaraz Vahedia long time.
61136f6b6cSFaraz VahediIt went through a lot of changes and improvements for ages.
62136f6b6cSFaraz VahediIn 1978, Brian W. Kernighan and Dennis M. Ritchie published the
63136f6b6cSFaraz Vahedifirst book about C under the title "The C Programming Language".
64136f6b6cSFaraz VahediWe can think of this book as the first specification of the language.
65136f6b6cSFaraz VahediThis version is often referred as K&R C after the names of the authors.
66136f6b6cSFaraz VahediSometimes it is referred as C78, as well, after the publishing year of
67136f6b6cSFaraz Vahedithe first edition of the book.
68136f6b6cSFaraz Vahedi.Pp
69136f6b6cSFaraz VahediIt is important to notice, that the instruction set of the language is
70136f6b6cSFaraz Vahedilimited to the most fundamental elements for simplicity.
71136f6b6cSFaraz VahediHandling of the standard I/O and such common functions are implemented in
72136f6b6cSFaraz Vahedithe libraries shipped with the compiler.
73136f6b6cSFaraz VahediAs these functions are also widely used, it was demanded to include into
74136f6b6cSFaraz Vahedithe description what requisites the library should conform to, not just
75136f6b6cSFaraz Vahedistrictly the language itself.
76136f6b6cSFaraz VahediAccordingly, the aforementioned standards cover the library elements, as well.
77136f6b6cSFaraz VahediThe elements of this standard library is still not enough for more
78136f6b6cSFaraz Vahedicomplicated tasks.
79136f6b6cSFaraz VahediIn this case the provided system calls of the given operating system can be
80136f6b6cSFaraz Vahediused.
81136f6b6cSFaraz VahediTo not lose the portability by using these system calls, the POSIX
82136f6b6cSFaraz Vahedi(Portable Operating System Interface) standard evolved.
83136f6b6cSFaraz VahediIt describes what functions should be available to keep portability.
84136f6b6cSFaraz VahediNote, that POSIX is not a C standard, but an operating system standard
85136f6b6cSFaraz Vahediand thus is beyond the scope of this manual.
86136f6b6cSFaraz VahediThe standards discussed below are all C standards and only cover
87136f6b6cSFaraz Vahedithe C programming language and the accompanying library.
88136f6b6cSFaraz VahediAll listed improvements for each standard edition are taken from the official
89136f6b6cSFaraz Vahedistandard drafts.
90136f6b6cSFaraz VahediFor further details, check the publicly available drafts or
91136f6b6cSFaraz Vahedipurchase the published standards \(em from either ISO or IEC resources.
92136f6b6cSFaraz Vahedi.Pp
93136f6b6cSFaraz VahediAfter the publication of the book mentioned before,
94136f6b6cSFaraz Vahedithe American National Standards Institute (ANSI) started to work on
95136f6b6cSFaraz Vahedistandardizing the language, and they announced ANSI X3.159-1989
96136f6b6cSFaraz Vahediin 1989.
97136f6b6cSFaraz VahediIt is usually referred to as ANSI C or C89.
98136f6b6cSFaraz VahediThe main difference in this standard were the function prototypes,
99136f6b6cSFaraz Vahediwhich is a new way of declaring functions.
100136f6b6cSFaraz VahediWith the old-style function declarations, the compiler was unable to
101136f6b6cSFaraz Vahedicheck the sanity of the actual parameters at a function call.
102136f6b6cSFaraz VahediThe old syntax was highly error-prone because incompatible parameters
103136f6b6cSFaraz Vahediwere hard to detect in the program code and the problem only showed up
104136f6b6cSFaraz Vahediat run-time.
105136f6b6cSFaraz Vahedi.Pp
106136f6b6cSFaraz VahediIn 1990, the International Organization for Standardization (ISO) adopted
107136f6b6cSFaraz Vahedithe ANSI standard as ISO/IEC 9899:1990 in 1990.
108136f6b6cSFaraz VahediThis is also referred to as ISO C or C90.
109136f6b6cSFaraz VahediIt only contains negligible minor modifications against ANSI C,
110136f6b6cSFaraz Vahediso the two standards often considered to be fully equivalent.
111136f6b6cSFaraz VahediThis was a very important milestone in the history of the C language, but the
112136f6b6cSFaraz Vahedidevelopment of the language did not stop.
113136f6b6cSFaraz Vahedi.Pp
114136f6b6cSFaraz VahediThe ISO C standard was later extended with an amendment as
115136f6b6cSFaraz VahediISO/IEC 9899/AMD1 in 1995.
1167e98eae7SFaraz VahediThis contained, for example, the wide-character support in
1177e98eae7SFaraz Vahedi.In wchar.h
1187e98eae7SFaraz Vahediand
1197e98eae7SFaraz Vahedi.In wctype.h ,
1207e98eae7SFaraz Vahediand also restricted character set support via diagraphs and
1217e98eae7SFaraz Vahedi.In iso646.h .
122136f6b6cSFaraz VahediThis amendment is usually referred to as C95.
123136f6b6cSFaraz VahediTwo technical corrigenda were also published: Technical Corrigendum 1 as
124136f6b6cSFaraz VahediISO/IEC 9899/COR1 in 1994 and Technical Corrigendum 2 as ISO/IEC 9899/COR2
125136f6b6cSFaraz Vahediin 1996.
126136f6b6cSFaraz VahediThe continuous development and growth made it necessary to work out a new
127136f6b6cSFaraz Vahedistandard, which contains the new features and fixes the known defects and
128136f6b6cSFaraz Vahedideficiencies of the language.
129136f6b6cSFaraz VahediAs a result, ISO/IEC 9899:1999 was born in 1999 as the second edition of the
130136f6b6cSFaraz Vahedistandard.
131136f6b6cSFaraz VahediSimilarly to the other standards, this is informally named after the
132136f6b6cSFaraz Vahedipublication year as C99.
133136f6b6cSFaraz VahediThe improvements include (but are not limited to) the following:
134136f6b6cSFaraz Vahedi.Bl -bullet -offset indent
135136f6b6cSFaraz Vahedi.It
136136f6b6cSFaraz Vahedidigraphs, trigraphs, and alternative spellings for the operators that
1377e98eae7SFaraz Vahediuse non-ISO646 characters in
1387e98eae7SFaraz Vahedi.In iso646.h
139136f6b6cSFaraz Vahedi.It
1407e98eae7SFaraz Vahediextended multibyte and wide character library support in
1417e98eae7SFaraz Vahedi.In wchar.h
1427e98eae7SFaraz Vahediand
1437e98eae7SFaraz Vahedi.In wctype.h
144136f6b6cSFaraz Vahedi.It
145136f6b6cSFaraz Vahedivariable length arrays
146136f6b6cSFaraz Vahedi.It
147136f6b6cSFaraz Vahediflexible array members
148136f6b6cSFaraz Vahedi.It
1497e98eae7SFaraz Vahedicomplex (and imaginary) number arithmetic support in
1507e98eae7SFaraz Vahedi.In complex.h
151136f6b6cSFaraz Vahedi.It
1527e98eae7SFaraz Vaheditype-generic math macros in
1537e98eae7SFaraz Vahedi.In tgmath.h
154136f6b6cSFaraz Vahedi.It
155136f6b6cSFaraz Vahedithe long long int type and library functions
156136f6b6cSFaraz Vahedi.It
157136f6b6cSFaraz Vahediremove implicit int type
158136f6b6cSFaraz Vahedi.It
159136f6b6cSFaraz Vahediuniversal character names (\eu and \eU)
160136f6b6cSFaraz Vahedi.It
161136f6b6cSFaraz Vahedicompound literals
162136f6b6cSFaraz Vahedi.It
163136f6b6cSFaraz Vahediremove implicit function declaration
164136f6b6cSFaraz Vahedi.It
165136f6b6cSFaraz VahediBCPL style single-line comments
166136f6b6cSFaraz Vahedi.It
167136f6b6cSFaraz Vahediallow mixed declarations and code
168136f6b6cSFaraz Vahedi.It
1697e98eae7SFaraz Vahedithe
1707e98eae7SFaraz Vahedi.Fn vscanf
1717e98eae7SFaraz Vahedifamily of functions in
1727e98eae7SFaraz Vahedi.In stdio.h
1737e98eae7SFaraz Vahediand
1747e98eae7SFaraz Vahedi.In wchar.h
175136f6b6cSFaraz Vahedi.It
176136f6b6cSFaraz Vahediallow trailing comma in enum declaration
177136f6b6cSFaraz Vahedi.It
178136f6b6cSFaraz Vahediinline functions
179136f6b6cSFaraz Vahedi.It
1807e98eae7SFaraz Vahedithe
1817e98eae7SFaraz Vahedi.Fn snprintf
1827e98eae7SFaraz Vahedifamily of functions in
1837e98eae7SFaraz Vahedi.In stdio.h
184136f6b6cSFaraz Vahedi.It
1857e98eae7SFaraz Vahediboolean type and macros in
1867e98eae7SFaraz Vahedi.In stdbool.h
187136f6b6cSFaraz Vahedi.It
188136f6b6cSFaraz Vahediempty macro arguments
189136f6b6cSFaraz Vahedi.It
190136f6b6cSFaraz Vahedi_Pragma preprocessing operator
191136f6b6cSFaraz Vahedi.It
192136f6b6cSFaraz Vahedi__func__ predefined identifier
193136f6b6cSFaraz Vahedi.It
1947e98eae7SFaraz Vahediva_copy macro in
1957e98eae7SFaraz Vahedi.In stdarg.h
196136f6b6cSFaraz Vahedi.It
197136f6b6cSFaraz Vahediadditional strftime conversion specifiers
198136f6b6cSFaraz Vahedi.El
199136f6b6cSFaraz Vahedi.Pp
200136f6b6cSFaraz VahediLater in 2011, the third edition of the standard, ISO/IEC 1989:2011,
201ef0ba6bcSMateusz Piotrowskicommonly referred to as C11 (formerly C1x), came out and replaced the
202136f6b6cSFaraz Vahedisecond edition by ISO/IEC 9899:1999/COR1:2001, ISO/IEC 9899:1999/COR2:2004,
203136f6b6cSFaraz Vahediand ISO/IEC 9899:1999/COR3:2007.
204136f6b6cSFaraz VahediThe improvements include (but are not limited to) the following:
205136f6b6cSFaraz Vahedi.Bl -bullet -offset indent
206136f6b6cSFaraz Vahedi.It
2077e98eae7SFaraz Vahedisupport for multiple threads of execution and atomic operations in
2087e98eae7SFaraz Vahedi.In threads.h
2097e98eae7SFaraz Vahediand
2107e98eae7SFaraz Vahedi.In stdatomic.h
211136f6b6cSFaraz Vahedi.It
2127e98eae7SFaraz Vahediadditional floating-point characteristic macros in
2137e98eae7SFaraz Vahedi.In float.h
214136f6b6cSFaraz Vahedi.It
2157e98eae7SFaraz Vahediquerying and specifying alignment of objects in
2167e98eae7SFaraz Vahedi.In stdalign.h
2177e98eae7SFaraz Vahediand
2187e98eae7SFaraz Vahedi.In stdlib.h
219136f6b6cSFaraz Vahedi.It
2207e98eae7SFaraz VahediUnicode character types and functions in
2217e98eae7SFaraz Vahedi.In uchar.h
222136f6b6cSFaraz Vahedi.It
223136f6b6cSFaraz Vaheditype-generic expressions
224136f6b6cSFaraz Vahedi.It
2257e98eae7SFaraz Vahedistatic assertions in
2267e98eae7SFaraz Vahedi.In assert.h
227136f6b6cSFaraz Vahedi.It
228136f6b6cSFaraz Vahedianonymous structures and unions
229136f6b6cSFaraz Vahedi.It
2307e98eae7SFaraz Vahediremove the gets function from
2317e98eae7SFaraz Vahedi.In stdio.h
232136f6b6cSFaraz Vahedi.It
2337e98eae7SFaraz Vahediadd the aligned_alloc, at_quick_exit, and quick_exit functions in
2347e98eae7SFaraz Vahedi.In stdlib.h
235136f6b6cSFaraz Vahedi.El
236136f6b6cSFaraz Vahedi.Pp
237136f6b6cSFaraz VahediC11 was later superseded by ISO/IEC 9899:2018, also known as C17 which was
238136f6b6cSFaraz Vahediprepared in 2017 and published in June 2018 as the fourth edition.
239136f6b6cSFaraz VahediIt incorporates the Technical Corrigendum 1 (ISO/IEC 9899:2011/COR1:2012)
240136f6b6cSFaraz Vahediwhich was published in 2012.
241136f6b6cSFaraz VahediIt addressed defects and deficiencies in C11 without introducing new features,
242136f6b6cSFaraz Vahedionly corrections and clarifications.
243136f6b6cSFaraz Vahedi.Pp
244*93065431SFaraz VahediC23, formally ISO/IEC 9899:2024, is the current standard with significant
245*93065431SFaraz Vahediupdates that supersede C17 (ISO/IEC 9899:2018).
246*93065431SFaraz VahediThe standardization effort began in 2016, informally as C2x, with the first
247*93065431SFaraz VahediWG14 meeting in 2019, and was officially published on October 31, 2024.
248*93065431SFaraz VahediC23 was originally anticipated for an earlier release, but the timeline was
249*93065431SFaraz Vahediextended due to COVID-19 pandemic.
250*93065431SFaraz VahediWith C23, the value of __STDC_VERSION__ has been updated from 201710L to
251*93065431SFaraz Vahedi202311L.
252*93065431SFaraz VahediKey changes include (but are not limited to) the following:
253*93065431SFaraz Vahedi.Bl -bullet -offset indent
254*93065431SFaraz Vahedi.It
255*93065431SFaraz VahediAdd null pointer type nullptr_t and the nullptr keyword
256*93065431SFaraz Vahedi.It
257*93065431SFaraz VahediAdd constexpr keyword as a storage-class specifier for objects
258*93065431SFaraz Vahedi.It
259*93065431SFaraz VahediRedefine the usage of the auto keyword to support type inference while also
260*93065431SFaraz Vahediretaining its previous functionality as a storage-class specifier when used
261*93065431SFaraz Vahediwith a type
262*93065431SFaraz Vahedi.It
263*93065431SFaraz VahediAdd %b binary conversion specifier to the
264*93065431SFaraz Vahedi.Fn printf
265*93065431SFaraz Vahediand
266*93065431SFaraz Vahedi.Fn scanf
267*93065431SFaraz Vahedifunction families
268*93065431SFaraz Vahedi.It
269*93065431SFaraz VahediAdd binary conversion support (0b and 0B) to the
270*93065431SFaraz Vahedi.Fn strtol
271*93065431SFaraz Vahediand
272*93065431SFaraz Vahedi.Fn wcstol
273*93065431SFaraz Vahedifunction families
274*93065431SFaraz Vahedi.It
275*93065431SFaraz VahediAdd the #embed directive for binary resource inclusion and __has_embed to
276*93065431SFaraz Vahedicheck resource availability with preprocessor directives
277*93065431SFaraz Vahedi.It
278*93065431SFaraz VahediAdd the #warning directive for diagnostics
279*93065431SFaraz Vahedi.It
280*93065431SFaraz VahediAdd the #elifdef and #elifndef directives
281*93065431SFaraz Vahedi.It
282*93065431SFaraz VahediAdd the u8 prefix for character literals to represent UTF-8 encoding,
283*93065431SFaraz Vahedicompatible with C++17
284*93065431SFaraz Vahedi.It
285*93065431SFaraz VahediAdd the char8_t type for UTF-8 encoded data and update the types of u8
286*93065431SFaraz Vahedicharacter constants and string literals to char8_t
287*93065431SFaraz Vahedi.It
288*93065431SFaraz VahediAdd functions
289*93065431SFaraz Vahedi.Fn mbrtoc8
290*93065431SFaraz Vahediand
291*93065431SFaraz Vahedi.Fn c8rtomb
292*93065431SFaraz Vahedito convert between narrow multibyte
293*93065431SFaraz Vahedicharacters and UTF-8 encoding
294*93065431SFaraz Vahedi.It
295*93065431SFaraz VahediDefine all char16_t strings and literals as UTF-16 encoded and char32_t
296*93065431SFaraz Vahedistrings and literals as UTF-32 encoded unless specified otherwise
297*93065431SFaraz Vahedi.It
298*93065431SFaraz VahediAllow storage-class specifiers within compound literals
299*93065431SFaraz Vahedi.It
300*93065431SFaraz VahediSupport the latest IEEE 754 standard, ISO/IEC 60559:2020, with binary and
301*93065431SFaraz Vahedi(optional) decimal floating-point arithmetic
302*93065431SFaraz Vahedi.It
303*93065431SFaraz VahediAdd single-argument _Static_assert for compatibility with C++17
304*93065431SFaraz Vahedi.It
305*93065431SFaraz VahediAdd _Decimal32, _Decimal64, _Decimal128 keywords for (optional) decimal
306*93065431SFaraz Vahedifloating-point arithmetic
307*93065431SFaraz Vahedi.It
308*93065431SFaraz VahediAdd digit separator ' (the single quote character) for literals
309*93065431SFaraz Vahedi.It
310*93065431SFaraz VahediEnable specification of the underlying type of an enum
311*93065431SFaraz Vahedi.It
312*93065431SFaraz VahediStandardize the
313*93065431SFaraz Vahedi.Fn typeof
314*93065431SFaraz Vahedioperator
315*93065431SFaraz Vahedi.It
316*93065431SFaraz VahediAdd
317*93065431SFaraz Vahedi.Fn memset_explicit
318*93065431SFaraz Vahediin
319*93065431SFaraz Vahedi.In string.h
320*93065431SFaraz Vahedito securely erase sensitive data
321*93065431SFaraz Vahediregardless of optimizations
322*93065431SFaraz Vahedi.It
323*93065431SFaraz VahediAdd
324*93065431SFaraz Vahedi.Fn memccpy
325*93065431SFaraz Vahediin
326*93065431SFaraz Vahedi.In string.h
327*93065431SFaraz Vahedifor efficient string concatenation
328*93065431SFaraz Vahedi.It
329*93065431SFaraz VahediAdd
330*93065431SFaraz Vahedi.Fn memalignment
331*93065431SFaraz Vahediin
332*93065431SFaraz Vahedi.In stdlib.h
333*93065431SFaraz Vahedito determine pointer alignment
334*93065431SFaraz Vahedi.It
335*93065431SFaraz VahediAdd
336*93065431SFaraz Vahedi.Fn strdup
337*93065431SFaraz Vahediand
338*93065431SFaraz Vahedi.Fn strndup
339*93065431SFaraz Vahediin
340*93065431SFaraz Vahedi.In string.h
341*93065431SFaraz Vahedito allocate string copies
342*93065431SFaraz Vahedi.It
343*93065431SFaraz VahediIntroduce bit utility functions, macros, and types in the new header
344*93065431SFaraz Vahedi.In stdbit.h
345*93065431SFaraz Vahedi.It
346*93065431SFaraz VahediAdd
347*93065431SFaraz Vahedi.Fn timegm
348*93065431SFaraz Vahediin
349*93065431SFaraz Vahedi.In time.h
350*93065431SFaraz Vahedifor converting time structures to calendar time
351*93065431SFaraz Vahedivalues
352*93065431SFaraz Vahedi.It
353*93065431SFaraz VahediAdd __has_include for header availability checking via preprocessor
354*93065431SFaraz Vahedidirectives
355*93065431SFaraz Vahedi.It
356*93065431SFaraz VahediAdd __has_c_attribute to check attribute availability via preprocessor
357*93065431SFaraz Vahedidirectives
358*93065431SFaraz Vahedi.It
359*93065431SFaraz VahediAdd _BitInt(N) and unsigned _BitInt(N) for bit-precise integers, and
360*93065431SFaraz VahediBITINT_MAXWIDTH for maximum bit width
361*93065431SFaraz Vahedi.It
362*93065431SFaraz VahediElevate true and false to proper keywords (previously macros from
363*93065431SFaraz Vahedi.In stdbool.h )
364*93065431SFaraz Vahedi.It
365*93065431SFaraz VahediAdd keywords alignas, alignof, bool, static_assert, thread_local; previously
366*93065431SFaraz Vahedidefined keywords remain available as alternative spellings
367*93065431SFaraz Vahedi.It
368*93065431SFaraz VahediEnable zero initialization with {} (including initialization of VLAs)
369*93065431SFaraz Vahedi.It
370*93065431SFaraz VahediIntroduce C++11 style attributes using [[]], with adding [[deprecated]],
371*93065431SFaraz Vahedi[[fallthrough]], [[maybe_unused]], [[nodiscard]], and [[noreturn]]
372*93065431SFaraz Vahedi.It
373*93065431SFaraz VahediDeprecate _Noreturn, noreturn, header
374*93065431SFaraz Vahedi.In stdnoreturn.h
375*93065431SFaraz Vahedifeatures introduced
376*93065431SFaraz Vahediin C11
377*93065431SFaraz Vahedi.It
378*93065431SFaraz VahediRemove trigraph support
379*93065431SFaraz Vahedi.It
380*93065431SFaraz VahediRemove K&R function definitions and declarations
381*93065431SFaraz Vahedi.It
382*93065431SFaraz VahediRemove non-two's-complement representations for signed integers
383*93065431SFaraz Vahedi.El
384136f6b6cSFaraz Vahedi.Pp
385*93065431SFaraz VahediThe next version of the C Standard, informally named C2y, is anticipated
386*93065431SFaraz Vahedito release within the next six years, targeting 2030 at the latest.
387*93065431SFaraz VahediA charter for C2y is still being drafted and discussed, with several
388*93065431SFaraz Vahedipapers under debate from the January 2024 meeting in Strasbourg, France
389*93065431SFaraz Vahediindicating that this new version may address long-standing requests and
390*93065431SFaraz Vahedideficiencies noted by the C community, while preserving its core strengths.
391136f6b6cSFaraz Vahedi.Pp
392136f6b6cSFaraz VahediISO/IEC JTC1/SC22/WG14 committee is responsible for the ISO/IEC 9899,
393136f6b6cSFaraz VahediC Standard.
394136f6b6cSFaraz Vahedi.Sh SEE ALSO
395136f6b6cSFaraz Vahedi.Xr c89 1 ,
396136f6b6cSFaraz Vahedi.Xr c99 1 ,
397136f6b6cSFaraz Vahedi.Xr cc 1
398136f6b6cSFaraz Vahedi.Sh STANDARDS
399136f6b6cSFaraz Vahedi.Rs
400136f6b6cSFaraz Vahedi.%A ANSI
401136f6b6cSFaraz Vahedi.%T X3.159-1989 (aka C89 or ANSI C)
402136f6b6cSFaraz Vahedi.Re
403136f6b6cSFaraz Vahedi.Pp
404136f6b6cSFaraz Vahedi.Rs
405136f6b6cSFaraz Vahedi.%A ISO/IEC
406136f6b6cSFaraz Vahedi.%T 9899:1990 (aka C90)
407136f6b6cSFaraz Vahedi.Re
408136f6b6cSFaraz Vahedi.Pp
409136f6b6cSFaraz Vahedi.Rs
410136f6b6cSFaraz Vahedi.%A ISO/IEC
411136f6b6cSFaraz Vahedi.%T 9899:1990/AMD 1:1995, Amendment 1: C Integrity (aka C95)
412136f6b6cSFaraz Vahedi.Re
413136f6b6cSFaraz Vahedi.Pp
414136f6b6cSFaraz Vahedi.Rs
415136f6b6cSFaraz Vahedi.%A ISO/IEC
416136f6b6cSFaraz Vahedi.%T 9899:1990/COR 1:1994, Technical Corrigendum 1
417136f6b6cSFaraz Vahedi.Re
418136f6b6cSFaraz Vahedi.Pp
419136f6b6cSFaraz Vahedi.Rs
420136f6b6cSFaraz Vahedi.%A ISO/IEC
421136f6b6cSFaraz Vahedi.%T 9899:1990/COR 2:1996, Technical Corrigendum 2
422136f6b6cSFaraz Vahedi.Re
423136f6b6cSFaraz Vahedi.Pp
424136f6b6cSFaraz Vahedi.Rs
425136f6b6cSFaraz Vahedi.%A ISO/IEC
426136f6b6cSFaraz Vahedi.%T 9899:1999 (aka C99)
427136f6b6cSFaraz Vahedi.Re
428136f6b6cSFaraz Vahedi.Pp
429136f6b6cSFaraz Vahedi.Rs
430136f6b6cSFaraz Vahedi.%A ISO/IEC
431136f6b6cSFaraz Vahedi.%T 9899:1999/COR 1:2001, Technical Corrigendum 1
432136f6b6cSFaraz Vahedi.Re
433136f6b6cSFaraz Vahedi.Pp
434136f6b6cSFaraz Vahedi.Rs
435136f6b6cSFaraz Vahedi.%A ISO/IEC
436136f6b6cSFaraz Vahedi.%T 9899:1999/COR 2:2004, Technical Corrigendum 2
437136f6b6cSFaraz Vahedi.Re
438136f6b6cSFaraz Vahedi.Pp
439136f6b6cSFaraz Vahedi.Rs
440136f6b6cSFaraz Vahedi.%A ISO/IEC
441136f6b6cSFaraz Vahedi.%T 9899:1999/COR 3:2007, Technical Corrigendum 3
442136f6b6cSFaraz Vahedi.Re
443136f6b6cSFaraz Vahedi.Pp
444136f6b6cSFaraz Vahedi.Rs
445136f6b6cSFaraz Vahedi.%A ISO/IEC
446136f6b6cSFaraz Vahedi.%T TR 24731-1:2007 (aka bounds-checking interfaces)
447136f6b6cSFaraz Vahedi.Re
448136f6b6cSFaraz Vahedi.Pp
449136f6b6cSFaraz Vahedi.Rs
450136f6b6cSFaraz Vahedi.%A ISO/IEC
451136f6b6cSFaraz Vahedi.%T TS 18037:2008 (aka, embedded C)
452136f6b6cSFaraz Vahedi.Re
453136f6b6cSFaraz Vahedi.Pp
454136f6b6cSFaraz Vahedi.Rs
455136f6b6cSFaraz Vahedi.%A ISO/IEC
456136f6b6cSFaraz Vahedi.%T TR 24747:2009 (aka mathematical special functions)
457136f6b6cSFaraz Vahedi.Re
458136f6b6cSFaraz Vahedi.Pp
459136f6b6cSFaraz Vahedi.Rs
460136f6b6cSFaraz Vahedi.%A ISO/IEC
461136f6b6cSFaraz Vahedi.%T TR 24732:2009 (aka decimal floating-point)
462136f6b6cSFaraz Vahedi.Re
463136f6b6cSFaraz Vahedi.Pp
464136f6b6cSFaraz Vahedi.Rs
465136f6b6cSFaraz Vahedi.%A ISO/IEC
466136f6b6cSFaraz Vahedi.%T TR 24731-2:2010 (aka dynamic allocation functions)
467136f6b6cSFaraz Vahedi.Re
468136f6b6cSFaraz Vahedi.Pp
469136f6b6cSFaraz Vahedi.Rs
470136f6b6cSFaraz Vahedi.%A ISO/IEC
471136f6b6cSFaraz Vahedi.%T 9899:2011 (aka C11)
472136f6b6cSFaraz Vahedi.Re
473136f6b6cSFaraz Vahedi.Pp
474136f6b6cSFaraz Vahedi.Rs
475136f6b6cSFaraz Vahedi.%A ISO/IEC
476136f6b6cSFaraz Vahedi.%T 9899:2011/COR 1:2012, Technical Corrigendum 1
477136f6b6cSFaraz Vahedi.Re
478136f6b6cSFaraz Vahedi.Pp
479136f6b6cSFaraz Vahedi.Rs
480136f6b6cSFaraz Vahedi.%A ISO/IEC
481136f6b6cSFaraz Vahedi.%T TS 17961:2013 (aka C secure coding rules)
482136f6b6cSFaraz Vahedi.Re
483136f6b6cSFaraz Vahedi.Pp
484136f6b6cSFaraz Vahedi.Rs
485136f6b6cSFaraz Vahedi.%A ISO/IEC
486136f6b6cSFaraz Vahedi.%T TS 18861-1:2014 (aka binary floating-point)
487136f6b6cSFaraz Vahedi.Re
488136f6b6cSFaraz Vahedi.Pp
489136f6b6cSFaraz Vahedi.Rs
490136f6b6cSFaraz Vahedi.%A ISO/IEC
491136f6b6cSFaraz Vahedi.%T TS 18861-2:2015 (aka decimal floating-point)
492136f6b6cSFaraz Vahedi.Re
493136f6b6cSFaraz Vahedi.Pp
494136f6b6cSFaraz Vahedi.Rs
495136f6b6cSFaraz Vahedi.%A ISO/IEC
496136f6b6cSFaraz Vahedi.%T TS 18861-3:2015 (aka interchange and extended types)
497136f6b6cSFaraz Vahedi.Re
498136f6b6cSFaraz Vahedi.Pp
499136f6b6cSFaraz Vahedi.Rs
500136f6b6cSFaraz Vahedi.%A ISO/IEC
501136f6b6cSFaraz Vahedi.%T TS 18861-4:2015 (aka supplementary functions)
502136f6b6cSFaraz Vahedi.Re
503136f6b6cSFaraz Vahedi.Pp
504136f6b6cSFaraz Vahedi.Rs
505136f6b6cSFaraz Vahedi.%A ISO/IEC
506136f6b6cSFaraz Vahedi.%T TS 17961:2013/COR 1:2016 (aka C secure coding rules TC1)
507136f6b6cSFaraz Vahedi.Re
508136f6b6cSFaraz Vahedi.Pp
509136f6b6cSFaraz Vahedi.Rs
510136f6b6cSFaraz Vahedi.%A ISO/IEC
511136f6b6cSFaraz Vahedi.%T TS 18861-5:2016 (aka supplementary attributes)
512136f6b6cSFaraz Vahedi.Re
513136f6b6cSFaraz Vahedi.Pp
514136f6b6cSFaraz Vahedi.Rs
515136f6b6cSFaraz Vahedi.%A ISO/IEC
516136f6b6cSFaraz Vahedi.%T 9899:2018 (aka C17)
517136f6b6cSFaraz Vahedi.Re
518*93065431SFaraz Vahedi.Pp
519*93065431SFaraz Vahedi.Rs
520*93065431SFaraz Vahedi.%A ISO/IEC
521*93065431SFaraz Vahedi.%T 9899:2024 (aka C23)
522*93065431SFaraz Vahedi.Re
523136f6b6cSFaraz Vahedi.Sh HISTORY
524136f6b6cSFaraz VahediThis manual page first appeared in
525136f6b6cSFaraz Vahedi.Fx 9.0 .
526136f6b6cSFaraz Vahedi.Sh AUTHORS
527136f6b6cSFaraz Vahedi.An -nosplit
528136f6b6cSFaraz VahediThis manual page was originally written by
529136f6b6cSFaraz Vahedi.An Gabor Kovesdan Aq Mt gabor@FreeBSD.org .
530*93065431SFaraz VahediIt was updated by
531136f6b6cSFaraz Vahedi.An Faraz Vahedi Aq Mt kfv@kfv.io
532136f6b6cSFaraz Vahediwith information about more recent C standards.
533