diff options
Diffstat (limited to 'static/freebsd/man9/cdefs.9 3.html')
| -rw-r--r-- | static/freebsd/man9/cdefs.9 3.html | 937 |
1 files changed, 0 insertions, 937 deletions
diff --git a/static/freebsd/man9/cdefs.9 3.html b/static/freebsd/man9/cdefs.9 3.html deleted file mode 100644 index 7c6680b3..00000000 --- a/static/freebsd/man9/cdefs.9 3.html +++ /dev/null @@ -1,937 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">CDEFS(9)</td> - <td class="head-vol">Kernel Developer's Manual</td> - <td class="head-rtitle">CDEFS(9)</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">cdefs</code> — <span class="Nd">compiler - portability macro definitions</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp"><code class="In"><<a class="In">sys/cdefs.h</a>></code> - defines macros for compiler, C language standard portability, POSIX - standards compliance and symbol visibility. It defines programming - interfaces for the system header files to adopt to the many environments - <span class="Ux">FreeBSD</span> supports compilation for. It defines - convenience macros for the <span class="Ux">FreeBSD</span> sources, tailored - to the base system's needs.</p> -<p class="Pp">Most of these macros are for use inside the - <span class="Ux">FreeBSD</span> sources only. They are not intended as a - general portability layer.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="Supported_Compilers"><a class="permalink" href="#Supported_Compilers">Supported - Compilers</a></h1> -<div class="Bd-indent"> -<dl class="Bl-tag"> - <dt>Compilers supported for building programs on - <span class="Ux">FreeBSD</span>:</dt> - <dd> - <table class="Bl-column Bd-indent"> - <tr id="Compiler"> - <td><a class="permalink" href="#Compiler"><b class="Sy">Compiler</b></a></td> - <td><a class="permalink" href="#Versions"><b class="Sy" id="Versions">Versions</b></a></td> - </tr> - <tr> - <td>gcc</td> - <td>9, 10, 11, 12, 13, 14</td> - </tr> - <tr> - <td>clang</td> - <td>10, 11, 12, 13, 14, 15, 16, 17, 18</td> - </tr> - <tr> - <td>TinyC (tcc)</td> - <td>0.9</td> - </tr> - <tr> - <td>pcc</td> - <td>1.1</td> - </tr> - </table> - <p class="Pp">Due to testing constraints, tcc and pcc may not always - work.</p> - </dd> - <dt>Compilers supported for building <span class="Ux">FreeBSD - itself:</span></dt> - <dd> - <table class="Bl-column Bd-indent"> - <tr id="Compiler~2"> - <td><a class="permalink" href="#Compiler~2"><b class="Sy">Compiler</b></a></td> - <td><a class="permalink" href="#Major"><b class="Sy" id="Major">Major - Versions Supported</b></a></td> - </tr> - <tr> - <td>gcc</td> - <td>12, 13, 14</td> - </tr> - <tr> - <td>clang</td> - <td>16, 17, 18</td> - </tr> - </table> - <p class="Pp">Please note: Not every single minor versions of these - compilers will work or are supported.</p> - </dd> -</dl> -</div> -</section> -<section class="Sh"> -<h1 class="Sh" id="Macros_and_Magic_for_Programming_Environment"><a class="permalink" href="#Macros_and_Magic_for_Programming_Environment">Macros - and Magic for Programming Environment</a></h1> -<p class="Pp"><code class="Nm">cdefs</code> defines (or refrains from defining) - a number of macros to increase portability of compiled programs. These are - to allow more advanced language features to appear in header files. The - header files assume a compiler that accepts C prototype function - declarations. They also assume that the compiler accepts ANSI C89 keywords - for all language dialects.</p> -<section class="Ss"> -<h2 class="Ss" id="General_Macros"><a class="permalink" href="#General_Macros">General - Macros</a></h2> -<p class="Pp">General macros that facilitate multiple language environments and - language dialects.</p> -<table class="Bl-column"> - <tr id="Macro"> - <td><a class="permalink" href="#Macro"><b class="Sy">Macro</b></a></td> - <td><a class="permalink" href="#Description"><b class="Sy" id="Description">Description</b></a></td> - </tr> - <tr id="__volatile"> - <td><a class="permalink" href="#__volatile"><code class="Dv">__volatile</code></a></td> - <td>expands to volatile in C++ and C89 and newer environments, __volatile in - pre-ANSI environments that support this extension or nothing - otherwise.</td> - </tr> - <tr id="__inline"> - <td><a class="permalink" href="#__inline"><code class="Dv">__inline</code></a></td> - <td>expands to inline in C++ and C89 and newer environments, __inline in - pre-ANSI environments that support this extension or nothing - otherwise.</td> - </tr> - <tr id="__restrict"> - <td><a class="permalink" href="#__restrict"><code class="Dv">__restrict</code></a></td> - <td>expands to restrict in C99 and newer environments, or __restrict - otherwise.</td> - </tr> - <tr id="__CONCAT"> - <td><a class="permalink" href="#__CONCAT"><code class="Dv">__CONCAT</code></a></td> - <td>used to paste two pre-processor tokens.</td> - </tr> - <tr id="__STRING"> - <td><a class="permalink" href="#__STRING"><code class="Dv">__STRING</code></a></td> - <td>used to convert the argument to a string.</td> - </tr> - <tr id="__BEGIN_DECLS"> - <td><a class="permalink" href="#__BEGIN_DECLS"><code class="Dv">__BEGIN_DECLS</code></a></td> - <td>Start a group of functions.</td> - </tr> - <tr id="__END_DECLS"> - <td><a class="permalink" href="#__END_DECLS"><code class="Dv">__END_DECLS</code></a></td> - <td>End a group of functions. In a C environment, these are defined as - nothing. In a C++ environment, these declare the functions to have - “C” linkage.</td> - </tr> -</table> -</section> -<section class="Ss"> -<h2 class="Ss" id="Function,_Structure_and_Variable_Modifiers"><a class="permalink" href="#Function,_Structure_and_Variable_Modifiers">Function, - Structure and Variable Modifiers</a></h2> -<table class="Bl-column"> - <tr id="Macro~2"> - <td><a class="permalink" href="#Macro~2"><b class="Sy">Macro</b></a></td> - <td><a class="permalink" href="#Description~2"><b class="Sy" id="Description~2">Description</b></a></td> - </tr> - <tr id="__weak_symbol"> - <td><a class="permalink" href="#__weak_symbol"><b class="Sy">__weak_symbol</b></a></td> - <td>Declare the symbol to be a weak symbol</td> - </tr> - <tr id="__dead2"> - <td><a class="permalink" href="#__dead2"><b class="Sy">__dead2</b></a></td> - <td>Function will not return</td> - </tr> - <tr id="__pure2"> - <td><a class="permalink" href="#__pure2"><b class="Sy">__pure2</b></a></td> - <td>Function has no side effects</td> - </tr> - <tr id="__unused"> - <td><a class="permalink" href="#__unused"><b class="Sy">__unused</b></a></td> - <td>To Variable may be unused (usually arguments), so do not warn about - it</td> - </tr> - <tr id="__used"> - <td><a class="permalink" href="#__used"><b class="Sy">__used</b></a></td> - <td>Function really is used, so emit it even if it appears unused.</td> - </tr> - <tr id="__deprecated"> - <td><a class="permalink" href="#__deprecated"><b class="Sy">__deprecated</b></a></td> - <td>Function interface has been deprecated, and clients should migrate to a - new interface. A warning will be issued for clients of this - interface.</td> - </tr> - <tr id="__deprecated1(msg)"> - <td><a class="permalink" href="#__deprecated1(msg)"><b class="Sy">__deprecated1(msg)</b></a></td> - <td>Function interface has been deprecated, and clients should migrate to a - new interface. The string <var class="Fa">msg</var> will be included in a - warning issued for clients of this interface.</td> - </tr> - <tr id="__packed"> - <td><a class="permalink" href="#__packed"><b class="Sy">__packed</b></a></td> - <td>Do not have space between structure elements for natural alignment. Used - when communicating with external protocols.</td> - </tr> - <tr id="__aligned(x)"> - <td><a class="permalink" href="#__aligned(x)"><b class="Sy">__aligned(x)</b></a></td> - <td>Specify in bytes the minimum alignment for the specified field, - structure or variable</td> - </tr> - <tr id="__section(x)"> - <td><a class="permalink" href="#__section(x)"><b class="Sy">__section(x)</b></a></td> - <td>Place function or variable in section <var class="Fa">x</var></td> - </tr> - <tr id="__writeonly"> - <td><a class="permalink" href="#__writeonly"><b class="Sy">__writeonly</b></a></td> - <td>Hint that the variable is only assigned to, but do not warn about it. - Useful for macros and other places the eventual use of the result is - unknown.</td> - </tr> - <tr id="__alloc_size(x)"> - <td><a class="permalink" href="#__alloc_size(x)"><b class="Sy">__alloc_size(x)</b></a></td> - <td>The function always returns at least the number of bytes determined by - argument number Fa x</td> - </tr> - <tr id="__alloc_size2(x,n)"> - <td><a class="permalink" href="#__alloc_size2(x,n)"><b class="Sy">__alloc_size2(x,n)</b></a></td> - <td>The function always returns an array, whose size is at least the number - of bytes determined by argument number Fa x times the number of elements - specified by argument number Fa n</td> - </tr> - <tr id="__alloc_align(x)"> - <td><a class="permalink" href="#__alloc_align(x)"><b class="Sy">__alloc_align(x)</b></a></td> - <td>Function either returns a pointer aligned to <var class="Fa">x - bytes</var> or Dv NULL.</td> - </tr> - <tr id="__min_size"> - <td><a class="permalink" href="#__min_size"><b class="Sy">__min_size</b></a></td> - <td>Declare the array to have a certain, minimum size</td> - </tr> - <tr id="__malloc_like"> - <td><a class="permalink" href="#__malloc_like"><b class="Sy">__malloc_like</b></a></td> - <td>Function behaves like the “malloc” family of - functions.</td> - </tr> - <tr id="__pure"> - <td><a class="permalink" href="#__pure"><b class="Sy">__pure</b></a></td> - <td>Function has no side effects</td> - </tr> - <tr id="__always_inline"> - <td><a class="permalink" href="#__always_inline"><b class="Sy">__always_inline</b></a></td> - <td>Always inline this function when called</td> - </tr> - <tr id="__fastcall"> - <td><a class="permalink" href="#__fastcall"><b class="Sy">__fastcall</b></a></td> - <td>Use the “fastcall” ABI to call and name mangle this - function.</td> - </tr> - <tr id="__result_use_check"> - <td><a class="permalink" href="#__result_use_check"><b class="Sy">__result_use_check</b></a></td> - <td>Warn if function caller does not use its return value</td> - </tr> - <tr id="__nodiscard"> - <td><a class="permalink" href="#__nodiscard"><b class="Sy">__nodiscard</b></a></td> - <td>Equivalent to the standard “[[nodiscard]]” attribute. If - applied to a function, warn if function caller does not use its return - value. The warning may be silenced using a cast to - <var class="Vt">void</var>, or in C++, using an assignment to - <var class="Va">std::ignore</var>. If applied to a struct, C++ class or - enum, this applies to all functions returning values of that type. If - applied to a C++ constructor, this applies to creating instances of the - class using that constructor.</td> - </tr> - <tr id="__returns_twice"> - <td><a class="permalink" href="#__returns_twice"><b class="Sy">__returns_twice</b></a></td> - <td>Returns multiple times, like <a class="Xr">fork(2)</a></td> - </tr> - <tr id="__unreachable"> - <td><a class="permalink" href="#__unreachable"><b class="Sy">__unreachable</b></a></td> - <td>This code is not reachable at runtime</td> - </tr> - <tr id="__predict_true(x)"> - <td><a class="permalink" href="#__predict_true(x)"><b class="Sy">__predict_true(x)</b></a></td> - <td>Hint to the compiler that <var class="Fa">x</var> is true most of the - time. Should only be used when performance is improved for a frequently - called bit of code.</td> - </tr> - <tr id="__predict_false(x)"> - <td><a class="permalink" href="#__predict_false(x)"><b class="Sy">__predict_false(x)</b></a></td> - <td>Hint to the compiler that <var class="Fa">x</var> is false most of the - time. Should only be used when performance is improved for a frequently - called bit of code.</td> - </tr> - <tr id="__null_sentinel"> - <td><a class="permalink" href="#__null_sentinel"><b class="Sy">__null_sentinel</b></a></td> - <td>The varadic function contains a parameter that is a NULL sentinel to - mark the end of its arguments.</td> - </tr> - <tr id="__exported"> - <td><a class="permalink" href="#__exported"><b class="Sy">__exported</b></a></td> - <td></td> - </tr> - <tr id="__hidden"> - <td><a class="permalink" href="#__hidden"><b class="Sy">__hidden</b></a></td> - <td></td> - </tr> - <tr id="__printflike(fmtarg,firstvararg)"> - <td><a class="permalink" href="#__printflike(fmtarg,firstvararg)"><b class="Sy">__printflike(fmtarg,firstvararg)</b></a></td> - <td>Function is similar to - <a class="permalink" href="#printf"><code class="Fn" id="printf">printf</code></a>() - which specifies the format argument with <var class="Fa">fmtarg</var> and - where the arguments formatted by that format start with the - <var class="Fa">firstvararg</var>, with 0 meaning that - <code class="Dv">va_arg</code> is used and cannot be checked.</td> - </tr> - <tr id="__scanflike(fmtarg,firstvararg)"> - <td><a class="permalink" href="#__scanflike(fmtarg,firstvararg)"><b class="Sy">__scanflike(fmtarg,firstvararg)</b></a></td> - <td>Function is similar to - <a class="permalink" href="#scanf"><code class="Fn" id="scanf">scanf</code></a>() - which specifies the format argument with <var class="Fa">fmtarg</var> and - where the arguments formatted by that format start with the - <var class="Fa">firstvararg</var>, with 0 meaning that - <code class="Dv">va_arg</code> is used and cannot be checked.</td> - </tr> - <tr id="__format_arg(f)"> - <td><a class="permalink" href="#__format_arg(f)"><b class="Sy">__format_arg(f)</b></a></td> - <td>Specifies that arg <var class="Fa">f</var> contains a string that will - be passed to a function like <code class="Fn">printf</code>() or - <var class="Fa">scanf</var> after being translated in some way.</td> - </tr> - <tr id="__strfmonlike(fmtarg,firstvararg)"> - <td><a class="permalink" href="#__strfmonlike(fmtarg,firstvararg)"><b class="Sy">__strfmonlike(fmtarg,firstvararg)</b></a></td> - <td>Function is similar to <code class="Fn">scanf</code>() which specifies - the format argument with <var class="Fa">fmtarg</var> and where the - arguments formatted by that format start with the - <var class="Fa">firstvararg</var>, with 0 meaning that - <code class="Dv">va_arg</code> is used and cannot be checked.</td> - </tr> - <tr id="__strtimelike(fmtarg,firstvararg)"> - <td><a class="permalink" href="#__strtimelike(fmtarg,firstvararg)"><b class="Sy">__strtimelike(fmtarg,firstvararg)</b></a></td> - <td>Function is similar to <code class="Fn">scanf</code>() which specifies - the format argument with <var class="Fa">fmtarg</var> and where the - arguments formatted by that format start with the - <var class="Fa">firstvararg</var>, with 0 meaning that - <code class="Dv">va_arg</code> is used and cannot be checked.</td> - </tr> - <tr id="__printf0like(fmtarg,firstvararg)"> - <td><a class="permalink" href="#__printf0like(fmtarg,firstvararg)"><b class="Sy">__printf0like(fmtarg,firstvararg)</b></a></td> - <td>Exactly the same as - <a class="permalink" href="#__printflike"><b class="Sy" id="__printflike">__printflike</b></a> - except <var class="Fa">fmtarg</var> may be - <code class="Dv">NULL.</code></td> - </tr> - <tr id="__strong_reference(sym,aliassym)"> - <td><a class="permalink" href="#__strong_reference(sym,aliassym)"><b class="Sy">__strong_reference(sym,aliassym)</b></a></td> - <td></td> - </tr> - <tr id="__weak_reference(sym,alias)"> - <td><a class="permalink" href="#__weak_reference(sym,alias)"><b class="Sy">__weak_reference(sym,alias)</b></a></td> - <td></td> - </tr> - <tr id="__warn_references(sym,msg)"> - <td><a class="permalink" href="#__warn_references(sym,msg)"><b class="Sy">__warn_references(sym,msg)</b></a></td> - <td></td> - </tr> - <tr id="__sym_compat(sym,impl,verid)"> - <td><a class="permalink" href="#__sym_compat(sym,impl,verid)"><b class="Sy">__sym_compat(sym,impl,verid)</b></a></td> - <td></td> - </tr> - <tr id="__sym_default(sym,impl,verid)"> - <td><a class="permalink" href="#__sym_default(sym,impl,verid)"><b class="Sy">__sym_default(sym,impl,verid)</b></a></td> - <td></td> - </tr> - <tr id="__GLOBAL(sym)"> - <td><a class="permalink" href="#__GLOBAL(sym)"><b class="Sy">__GLOBAL(sym)</b></a></td> - <td></td> - </tr> - <tr id="__WEAK(sym)"> - <td><a class="permalink" href="#__WEAK(sym)"><b class="Sy">__WEAK(sym)</b></a></td> - <td></td> - </tr> - <tr id="__DECONST(type,var)"> - <td><a class="permalink" href="#__DECONST(type,var)"><b class="Sy">__DECONST(type,var)</b></a></td> - <td></td> - </tr> - <tr id="__DEVOLATILE(type,var)"> - <td><a class="permalink" href="#__DEVOLATILE(type,var)"><b class="Sy">__DEVOLATILE(type,var)</b></a></td> - <td></td> - </tr> - <tr id="__DEQUALIFY(type,var)"> - <td><a class="permalink" href="#__DEQUALIFY(type,var)"><b class="Sy">__DEQUALIFY(type,var)</b></a></td> - <td></td> - </tr> - <tr id="__RENAME(x)"> - <td><a class="permalink" href="#__RENAME(x)"><b class="Sy">__RENAME(x)</b></a></td> - <td></td> - </tr> - <tr id="__arg_type_tag"> - <td><a class="permalink" href="#__arg_type_tag"><b class="Sy">__arg_type_tag</b></a></td> - <td></td> - </tr> - <tr id="__datatype_type_tag"> - <td><a class="permalink" href="#__datatype_type_tag"><b class="Sy">__datatype_type_tag</b></a></td> - <td></td> - </tr> - <tr id="__align_up(x,y)"> - <td><a class="permalink" href="#__align_up(x,y)"><b class="Sy">__align_up(x,y)</b></a></td> - <td></td> - </tr> - <tr id="__align_down(x,y)"> - <td><a class="permalink" href="#__align_down(x,y)"><b class="Sy">__align_down(x,y)</b></a></td> - <td></td> - </tr> - <tr id="__is_aligned(x,y)"> - <td><a class="permalink" href="#__is_aligned(x,y)"><b class="Sy">__is_aligned(x,y)</b></a></td> - <td></td> - </tr> -</table> -</section> -<section class="Ss"> -<h2 class="Ss" id="Locking_and_Debugging_Macros"><a class="permalink" href="#Locking_and_Debugging_Macros">Locking - and Debugging Macros</a></h2> -<p class="Pp">Macros for lock annotation and debugging, as well as some general - debugging macros for address sanitizers.</p> -<table class="Bl-column"> - <tr id="__lock_annotate(x)"> - <td><a class="permalink" href="#__lock_annotate(x)"><b class="Sy">__lock_annotate(x)</b></a></td> - <td></td> - </tr> - <tr id="__lockable"> - <td><a class="permalink" href="#__lockable"><b class="Sy">__lockable</b></a></td> - <td></td> - </tr> - <tr id="__locks_exclusive"> - <td><a class="permalink" href="#__locks_exclusive"><b class="Sy">__locks_exclusive</b></a></td> - <td></td> - </tr> - <tr id="__locks_shared"> - <td><a class="permalink" href="#__locks_shared"><b class="Sy">__locks_shared</b></a></td> - <td></td> - </tr> - <tr id="__trylocks_exclusive"> - <td><a class="permalink" href="#__trylocks_exclusive"><b class="Sy">__trylocks_exclusive</b></a></td> - <td></td> - </tr> - <tr id="__trylocks_shared"> - <td><a class="permalink" href="#__trylocks_shared"><b class="Sy">__trylocks_shared</b></a></td> - <td></td> - </tr> - <tr id="__unlocks"> - <td><a class="permalink" href="#__unlocks"><b class="Sy">__unlocks</b></a></td> - <td></td> - </tr> - <tr id="__asserts_exclusive"> - <td><a class="permalink" href="#__asserts_exclusive"><b class="Sy">__asserts_exclusive</b></a></td> - <td></td> - </tr> - <tr id="__asserts_shared"> - <td><a class="permalink" href="#__asserts_shared"><b class="Sy">__asserts_shared</b></a></td> - <td></td> - </tr> - <tr id="__requires_exclusive"> - <td><a class="permalink" href="#__requires_exclusive"><b class="Sy">__requires_exclusive</b></a></td> - <td></td> - </tr> - <tr id="__requires_shared"> - <td><a class="permalink" href="#__requires_shared"><b class="Sy">__requires_shared</b></a></td> - <td></td> - </tr> - <tr id="__requires_unlocked"> - <td><a class="permalink" href="#__requires_unlocked"><b class="Sy">__requires_unlocked</b></a></td> - <td></td> - </tr> - <tr id="__no_lock_analysis"> - <td><a class="permalink" href="#__no_lock_analysis"><b class="Sy">__no_lock_analysis</b></a></td> - <td></td> - </tr> - <tr id="__nosanitizeaddress"> - <td><a class="permalink" href="#__nosanitizeaddress"><b class="Sy">__nosanitizeaddress</b></a></td> - <td></td> - </tr> - <tr id="__nosanitizememory"> - <td><a class="permalink" href="#__nosanitizememory"><b class="Sy">__nosanitizememory</b></a></td> - <td></td> - </tr> - <tr id="__nosanitizethread"> - <td><a class="permalink" href="#__nosanitizethread"><b class="Sy">__nosanitizethread</b></a></td> - <td></td> - </tr> - <tr id="__nostackprotector"> - <td><a class="permalink" href="#__nostackprotector"><b class="Sy">__nostackprotector</b></a></td> - <td></td> - </tr> - <tr id="__guarded_by(x)"> - <td><a class="permalink" href="#__guarded_by(x)"><b class="Sy">__guarded_by(x)</b></a></td> - <td></td> - </tr> - <tr id="__pt_guarded_by(x)"> - <td><a class="permalink" href="#__pt_guarded_by(x)"><b class="Sy">__pt_guarded_by(x)</b></a></td> - <td></td> - </tr> -</table> -</section> -<section class="Ss"> -<h2 class="Ss" id="Emulated_Keywords"><a class="permalink" href="#Emulated_Keywords">Emulated - Keywords</a></h2> -<p class="Pp">As C evolves, many of the old macros we once used have been - incorporated into the standard language. As this happens, we add support for - these keywords as macros for older compilation environments. Sometimes this - results in a nop in the older environment.</p> -<table class="Bl-column"> - <tr id="Keyword"> - <td><a class="permalink" href="#Keyword"><b class="Sy">Keyword</b></a></td> - <td><a class="permalink" href="#Description~3"><b class="Sy" id="Description~3">Description</b></a></td> - </tr> - <tr id="_Alignas(x)"> - <td><a class="permalink" href="#_Alignas(x)"><b class="Sy">_Alignas(x)</b></a></td> - <td></td> - </tr> - <tr id="_Alignof(x)"> - <td><a class="permalink" href="#_Alignof(x)"><b class="Sy">_Alignof(x)</b></a></td> - <td></td> - </tr> - <tr id="_Noreturn"> - <td><a class="permalink" href="#_Noreturn"><b class="Sy">_Noreturn</b></a></td> - <td>Expands to “[[noreturn]]” in C++-11 and newer compilation - environments, otherwise “__dead2”</td> - </tr> - <tr id="_Static_assert(x,"> - <td><a class="permalink" href="#_Static_assert(x,"><b class="Sy">_Static_assert(x, - y)</b></a></td> - <td>Compile time assertion that <var class="Fa">x</var> is true, otherwise - emit <var class="Fa">y</var> as the error message.</td> - </tr> - <tr id="_Thread_local"> - <td><a class="permalink" href="#_Thread_local"><b class="Sy">_Thread_local</b></a></td> - <td>Designate variable as thread local storage</td> - </tr> - <tr id="__generic"> - <td><a class="permalink" href="#__generic"><b class="Sy">__generic</b></a></td> - <td>implement _Generic-like features which aren't entirely possible to - emulate the _Generic keyword</td> - </tr> - <tr id="__noexcept"> - <td><a class="permalink" href="#__noexcept"><b class="Sy">__noexcept</b></a></td> - <td>to emulate the C++11 argument-less noexcept form</td> - </tr> - <tr id="__noexcept_if"> - <td><a class="permalink" href="#__noexcept_if"><b class="Sy">__noexcept_if</b></a></td> - <td>to emulate the C++11 conditional noexcept form</td> - </tr> - <tr id="_Nonnull"> - <td><a class="permalink" href="#_Nonnull"><b class="Sy">_Nonnull</b></a></td> - <td></td> - </tr> - <tr id="_Nullable"> - <td><a class="permalink" href="#_Nullable"><b class="Sy">_Nullable</b></a></td> - <td></td> - </tr> - <tr id="_Null_unspecified"> - <td><a class="permalink" href="#_Null_unspecified"><b class="Sy">_Null_unspecified</b></a></td> - <td></td> - </tr> -</table> -</section> -<section class="Ss"> -<h2 class="Ss" id="Support_Macros"><a class="permalink" href="#Support_Macros">Support - Macros</a></h2> -<p class="Pp">The following macros are defined, or have specific values, to - denote certain things about the build environment.</p> -<table class="Bl-column"> - <tr id="Macro~3"> - <td><a class="permalink" href="#Macro~3"><b class="Sy">Macro</b></a></td> - <td><a class="permalink" href="#Description~4"><b class="Sy" id="Description~4">Description</b></a></td> - </tr> - <tr id="__LONG_LONG_SUPPORTED"> - <td><a class="permalink" href="#__LONG_LONG_SUPPORTED"><b class="Sy">__LONG_LONG_SUPPORTED</b></a></td> - <td>Variables may be declared “long long”. This is defined for - C99 or newer and C++ environments.</td> - </tr> - <tr id="__STDC_LIMIT_MACROS"> - <td><a class="permalink" href="#__STDC_LIMIT_MACROS"><b class="Sy">__STDC_LIMIT_MACROS</b></a></td> - <td></td> - </tr> - <tr id="__STDC_CONSTANT_MACROS"> - <td><a class="permalink" href="#__STDC_CONSTANT_MACROS"><b class="Sy">__STDC_CONSTANT_MACROS</b></a></td> - <td></td> - </tr> -</table> -</section> -<section class="Ss"> -<h2 class="Ss" id="Convenience_Macros"><a class="permalink" href="#Convenience_Macros">Convenience - Macros</a></h2> -<p class="Pp">These macros make it easier to do a number of things, even though - strictly speaking the standard places their normal form in another - header.</p> -<table class="Bl-column"> - <tr id="Macro~4"> - <td><a class="permalink" href="#Macro~4"><b class="Sy">Macro</b></a></td> - <td><a class="permalink" href="#Description~5"><b class="Sy" id="Description~5">Description</b></a></td> - </tr> - <tr id="__offsetof(type,field)"> - <td><a class="permalink" href="#__offsetof(type,field)"><b class="Sy">__offsetof(type,field)</b></a></td> - <td></td> - </tr> - <tr id="__rangeof(type,start,end)"> - <td><a class="permalink" href="#__rangeof(type,start,end)"><b class="Sy">__rangeof(type,start,end)</b></a></td> - <td></td> - </tr> - <tr id="__containerof(x,s,m)"> - <td><a class="permalink" href="#__containerof(x,s,m)"><b class="Sy">__containerof(x,s,m)</b></a></td> - <td></td> - </tr> -</table> -</section> -<section class="Ss"> -<h2 class="Ss" id="ID_Strings"><a class="permalink" href="#ID_Strings">ID - Strings</a></h2> -<p class="Pp">This section is deprecated, but is kept around because too much - contrib software still uses these.</p> -<table class="Bl-column"> - <tr id="Macro~5"> - <td><a class="permalink" href="#Macro~5"><b class="Sy">Macro</b></a></td> - <td><a class="permalink" href="#Description~6"><b class="Sy" id="Description~6">Description</b></a></td> - </tr> - <tr id="__IDSTRING(name,string)"> - <td><a class="permalink" href="#__IDSTRING(name,string)"><b class="Sy">__IDSTRING(name,string)</b></a></td> - <td></td> - </tr> - <tr id="__FBSDID(s)"> - <td><a class="permalink" href="#__FBSDID(s)"><b class="Sy">__FBSDID(s)</b></a></td> - <td></td> - </tr> - <tr id="__RCSID(s)"> - <td><a class="permalink" href="#__RCSID(s)"><b class="Sy">__RCSID(s)</b></a></td> - <td></td> - </tr> - <tr id="__RCSID_SOURCE(s)"> - <td><a class="permalink" href="#__RCSID_SOURCE(s)"><b class="Sy">__RCSID_SOURCE(s)</b></a></td> - <td></td> - </tr> - <tr id="__SCCSID(s)"> - <td><a class="permalink" href="#__SCCSID(s)"><b class="Sy">__SCCSID(s)</b></a></td> - <td></td> - </tr> - <tr id="__COPYRIGHT(s)"> - <td><a class="permalink" href="#__COPYRIGHT(s)"><b class="Sy">__COPYRIGHT(s)</b></a></td> - <td></td> - </tr> -</table> -</section> -</section> -<section class="Sh"> -<h1 class="Sh" id="Supported_C_Environments"><a class="permalink" href="#Supported_C_Environments">Supported - C Environments</a></h1> -<p class="Pp"><span class="Ux">FreeBSD</span> supports a number C standard - environments. Selection of the language dialect is a compiler-dependent - command line option, though it is usually <code class="Fl">-std=XX</code> - where XX is the standard to set for compiling, such as c89 or c23. - <span class="Ux">FreeBSD</span> provides a number of selection macros to - control visibility of symbols. Please see the section on Selection Macros - for the specifics.</p> -<dl class="Bl-tag"> - <dt>K & R</dt> - <dd>Pre-ANSI Kernighan and Ritchie C. Sometimes called “knr” or - “C78” to distinguish it from newer standards. Support for - this compilation environment is dependent on compilers supporting this - configuration. Most of the old forms of C have been deprecated or removed - in. Compilers make compiling in this mode increasingly difficult and - support for it may ultimately be removed from the tree.</dd> - <dt id="__STDC__"><span class="St">ANSI X3.159-1989 - (“ANSI C89”)</span></dt> - <dd><a class="permalink" href="#__STDC__"><code class="Dv">__STDC__</code></a> - is defined, however <code class="Dv">__STDC_VERSION__</code> is not. - <p class="Pp">Strict environment selected with - <code class="Dv">_ANSI_SOURCE</code>.</p> - </dd> - <dt id="__STDC_VERSION__"><span class="St">ISO/IEC 9899:1999 - (“ISO C99”)</span></dt> - <dd><a class="permalink" href="#__STDC_VERSION__"><code class="Dv">__STDC_VERSION__ - = 199901L</code></a> - <p class="Pp">Strict environment selected with - <code class="Dv">_C99_SOURCE</code>.</p> - </dd> - <dt id="__STDC_VERSION__~2"><span class="St">ISO/IEC 9899:2011 - (“ISO C11”)</span></dt> - <dd><a class="permalink" href="#__STDC_VERSION__~2"><code class="Dv">__STDC_VERSION__ - = 201112L</code></a> - <p class="Pp">Strict environment selected with - <code class="Dv">_C11_SOURCE</code>.</p> - </dd> - <dt id="__STDC_VERSION__~3">ISO/IEC 9899:2018 (“ISO C17”)</dt> - <dd><a class="permalink" href="#__STDC_VERSION__~3"><code class="Dv">__STDC_VERSION__ - = 201710L</code></a> - <p class="Pp">Strict environment selected with - <code class="Dv">_C11_SOURCE</code> since there are no new C17 only - symbols or macros.</p> - <p class="Pp">This version of the standard did not introduce any new - features, only made minor, technical corrections.</p> - </dd> - <dt id="__STDC_VERSION__~4"></dt> - <dd><a class="permalink" href="#__STDC_VERSION__~4"><code class="Dv">__STDC_VERSION__ - = 202311L</code></a> Strict environment selected with - <code class="Dv">_C23_SOURCE</code> though ISO C23 support is only - partially implemented.</dd> -</dl> -<p class="Pp">For more information on C standards, see - <a class="Xr">c(7)</a>.</p> -<section class="Ss"> -<h2 class="Ss" id="Programming_Environment_Selection_Macros"><a class="permalink" href="#Programming_Environment_Selection_Macros">Programming - Environment Selection Macros</a></h2> -<p class="Pp">Defining the macros outlined below requests that the system header - files provide only the functions, structures and macros (symbols) defined by - the appropriate standard, while suppressing all extensions. However, system - headers not defined by that standard may define extensions. You may only - define one of the following for any compilation unit.</p> -<table class="Bl-column"> - <tr id="Macro~6"> - <td><a class="permalink" href="#Macro~6"><b class="Sy">Macro</b></a></td> - <td><a class="permalink" href="#Environment"><b class="Sy" id="Environment">Environment</b></a></td> - </tr> - <tr id="_POSIX_SOURCE"> - <td><a class="permalink" href="#_POSIX_SOURCE"><code class="Dv">_POSIX_SOURCE</code></a></td> - <td><span class="St">IEEE Std 1003.1-1988 (“POSIX.1”)</span> - including <span class="St">ANSI X3.159-1989 - (“ANSI C89”)</span></td> - </tr> - <tr id="_POSIX_C_SOURCE"> - <td><a class="permalink" href="#_POSIX_C_SOURCE"><code class="Dv">_POSIX_C_SOURCE - = 1</code></a></td> - <td><span class="St">IEEE Std 1003.1-1988 (“POSIX.1”)</span> - including <span class="St">ANSI X3.159-1989 - (“ANSI C89”)</span></td> - </tr> - <tr id="_POSIX_C_SOURCE~2"> - <td><a class="permalink" href="#_POSIX_C_SOURCE~2"><code class="Dv">_POSIX_C_SOURCE - = 2</code></a></td> - <td><span class="St">IEEE Std 1003.1-1990 (“POSIX.1”)</span> - including <span class="St">ANSI X3.159-1989 - (“ANSI C89”)</span></td> - </tr> - <tr id="_POSIX_C_SOURCE~3"> - <td><a class="permalink" href="#_POSIX_C_SOURCE~3"><code class="Dv">_POSIX_C_SOURCE - = 199309</code></a></td> - <td><span class="St">IEEE Std 1003.1b-1993 (“POSIX.1b”)</span> - including <span class="St">ANSI X3.159-1989 - (“ANSI C89”)</span></td> - </tr> - <tr id="_POSIX_C_SOURCE~4"> - <td><a class="permalink" href="#_POSIX_C_SOURCE~4"><code class="Dv">_POSIX_C_SOURCE - = 199506</code></a></td> - <td><span class="St">IEEE Std 1003.1c-1995 (“POSIX.1c”)</span> - including <span class="St">ANSI X3.159-1989 - (“ANSI C89”)</span></td> - </tr> - <tr id="_POSIX_C_SOURCE~5"> - <td><a class="permalink" href="#_POSIX_C_SOURCE~5"><code class="Dv">_POSIX_C_SOURCE - = 200112</code></a></td> - <td><span class="St">IEEE Std 1003.1-2001 (“POSIX.1”)</span> - including <span class="St">ISO/IEC 9899:1999 - (“ISO C99”)</span></td> - </tr> - <tr id="_POSIX_C_SOURCE~6"> - <td><a class="permalink" href="#_POSIX_C_SOURCE~6"><code class="Dv">_POSIX_C_SOURCE - = 200809</code></a></td> - <td><span class="St">IEEE Std 1003.1-2008 (“POSIX.1”)</span> - including <span class="St">ISO/IEC 9899:1999 - (“ISO C99”)</span></td> - </tr> - <tr id="_POSIX_C_SOURCE~7"> - <td><a class="permalink" href="#_POSIX_C_SOURCE~7"><code class="Dv">_POSIX_C_SOURCE - = 202405</code></a></td> - <td>including ISO/IEC 9899:2018 ("ISO C17"),</td> - </tr> - <tr id="_XOPEN_SOURCE"> - <td><a class="permalink" href="#_XOPEN_SOURCE"><code class="Dv">_XOPEN_SOURCE - defined</code></a></td> - <td><span class="St">IEEE Std 1003.1-1990 (“POSIX.1”)</span> - with XPG Extensions to <span class="St">Version 1 of the Single - UNIX Specification (“SUSv1”)</span> including - <span class="St">ANSI X3.159-1989 - (“ANSI C89”)</span>. However, - <span class="Ux">FreeBSD</span> implements this as a NOP because too much - software breaks with the correct strict environment.</td> - </tr> - <tr id="_XOPEN_SOURCE~2"> - <td><a class="permalink" href="#_XOPEN_SOURCE~2"><code class="Dv">_XOPEN_SOURCE - = 500</code></a></td> - <td><span class="St">IEEE Std 1003.1c-1995 (“POSIX.1c”)</span> - and XPG extensions to <span class="St">Version 2 of the Single UNIX - Specification (“SUSv2”)</span> including - <span class="St">ANSI X3.159-1989 - (“ANSI C89”)</span></td> - </tr> - <tr id="_XOPEN_SOURCE~3"> - <td><a class="permalink" href="#_XOPEN_SOURCE~3"><code class="Dv">_XOPEN_SOURCE - = 600</code></a></td> - <td><span class="St">IEEE Std 1003.1-2001 (“POSIX.1”)</span> - and XPG extensions to <span class="St">Version 3 of the Single UNIX - Specification (“SUSv3”)</span> including - <span class="St">ISO/IEC 9899:1999 - (“ISO C99”)</span></td> - </tr> - <tr id="_XOPEN_SOURCE~4"> - <td><a class="permalink" href="#_XOPEN_SOURCE~4"><code class="Dv">_XOPEN_SOURCE - = 700</code></a></td> - <td><span class="St">IEEE Std 1003.1-2008 (“POSIX.1”)</span> - and XPG extensions to <span class="St">Version 4 of the Single UNIX - Specification (“SUSv4”)</span> including - <span class="St">ISO/IEC 9899:1999 - (“ISO C99”)</span></td> - </tr> - <tr id="_XOPEN_SOURCE~5"> - <td><a class="permalink" href="#_XOPEN_SOURCE~5"><code class="Dv">_XOPEN_SOURCE - = 800</code></a></td> - <td>and XPG extensions to Version 5 of the Single UNIX Specification - (“SUSv5”) including ISO/IEC 9899:2018 (“ISO - C17”)</td> - </tr> - <tr id="_ANSI_SOURCE"> - <td><a class="permalink" href="#_ANSI_SOURCE"><code class="Dv">_ANSI_SOURCE</code></a></td> - <td><span class="St">ANSI X3.159-1989 - (“ANSI C89”)</span></td> - </tr> - <tr id="_C99_SOURCE"> - <td><a class="permalink" href="#_C99_SOURCE"><code class="Dv">_C99_SOURCE</code></a></td> - <td><span class="St">ISO/IEC 9899:1999 - (“ISO C99”)</span></td> - </tr> - <tr id="_C11_SOURCE"> - <td><a class="permalink" href="#_C11_SOURCE"><code class="Dv">_C11_SOURCE</code></a></td> - <td><span class="St">ISO/IEC 9899:2011 - (“ISO C11”)</span></td> - </tr> - <tr id="_C23_SOURCE"> - <td><a class="permalink" href="#_C23_SOURCE"><code class="Dv">_C23_SOURCE</code></a></td> - <td></td> - </tr> - <tr id="_BSD_SOURCE"> - <td><a class="permalink" href="#_BSD_SOURCE"><code class="Dv">_BSD_SOURCE</code></a></td> - <td>Everything, including <span class="Ux">FreeBSD extensions</span></td> - </tr> -</table> -<p class="Pp">Note: and XPG extensions to Version 5 of the Single UNIX - Specification ("SUSv5") support is incomplete.</p> -<p class="Pp">When both POSIX and C environments are selected, the POSIX - environment selects which C environment is used. However, when C11 dialect - is selected with <span class="St">IEEE Std 1003.1-2008 - (“POSIX.1”)</span>, definitions for <span class="St">ISO/IEC - 9899:2011 (“ISO C11”)</span> are also included. - Likewise, when C23 dialog is selected with <span class="St">IEEE Std - 1003.1-2008 (“POSIX.1”)</span> or, definitions for are also - included.</p> -</section> -<section class="Ss"> -<h2 class="Ss" id="Header_Visibility_Macros"><a class="permalink" href="#Header_Visibility_Macros">Header - Visibility Macros</a></h2> -<p class="Pp">These macros are set by <code class="Nm">cdefs</code> to control - the visibility of different standards. Users must not define these, and - doing so will produced undefined results. They are documented here for - developers working on system's header files.</p> -<table class="Bl-column"> - <tr id="__XSI_VISIBLE"> - <td><a class="permalink" href="#__XSI_VISIBLE"><code class="Dv">__XSI_VISIBLE</code></a></td> - <td>Restricts the visibility of XOPEN Single Unix Standard version. Possible - values are 500, 600, 700 or 800, corresponding to Issue 5, 6, 7, or 8 of - the Single Unix Standard. These are extra functions in addition to the - normal POSIX ones.</td> - </tr> - <tr id="__POSIX_VISIBLE"> - <td><a class="permalink" href="#__POSIX_VISIBLE"><code class="Dv">__POSIX_VISIBLE</code></a></td> - <td>Make symbols associated with certain standards versions visible. Set to - the value assigned to <code class="Dv">_POSIX_C_SOURCE</code> by - convention with 199009 for <span class="St">IEEE Std 1003.1-1988 - (“POSIX.1”)</span> and 199209 <span class="St">IEEE Std - 1003.1-1990 (“POSIX.1”)</span>.</td> - </tr> - <tr id="__ISO_C_VISIBLE"> - <td><a class="permalink" href="#__ISO_C_VISIBLE"><code class="Dv">__ISO_C_VISIBLE</code></a></td> - <td>The C level that's visible. Possible values include 1990, 1999, 2011, - 2017 and 2023 for <span class="St">ISO/IEC 9899:1990 - (“ISO C90”)</span>, <span class="St">ISO/IEC - 9899:1999 (“ISO C99”)</span>, - <span class="St">ISO/IEC 9899:2011 - (“ISO C11”)</span>, ISO/IEC 9899:2018 ("ISO - C17"), and, respectively.</td> - </tr> - <tr id="__BSD_VISIBLE"> - <td><a class="permalink" href="#__BSD_VISIBLE"><code class="Dv">__BSD_VISIBLE</code></a></td> - <td>1 if the <span class="Ux">FreeBSD</span> extensions are visible, 0 - otherwise.</td> - </tr> - <tr id="__EXT1_VISIBLE"> - <td><a class="permalink" href="#__EXT1_VISIBLE"><code class="Dv">__EXT1_VISIBLE</code></a></td> - <td>1 if the <span class="St">ISO/IEC 9899:2011 - (“ISO C11”)</span> Appendix K 3.7.4.1 extensions are - visible, 0 otherwise.</td> - </tr> -</table> -</section> -</section> -<section class="Sh"> -<h1 class="Sh" id="Supported_C++_Environments"><a class="permalink" href="#Supported_C++_Environments">Supported - C++ Environments</a></h1> -<p class="Pp"><span class="Ux">FreeBSD</span> supports C++11 and newer standards - fully.</p> -<dl class="Bl-tag"> - <dt id="__cplusplus">ISO/IEC 14882:1998 ("C++98")</dt> - <dd><a class="permalink" href="#__cplusplus"><code class="Dv">__cplusplus = - 199711</code></a> - <p class="Pp">The first standardized version of C++. Unlike K & R - support in C, compilers dropped support for versions of the language - prior to C++98.</p> - </dd> - <dt id="__cplusplus~2">ISO/IEC 14882:2003 ("C++03")</dt> - <dd><a class="permalink" href="#__cplusplus~2"><code class="Dv">__cplusplus = - 199711</code></a> - <p class="Pp">Note, this is the same value as C++98. C++03 did not define a - new value for <code class="Dv">__cplusplus</code>. There is no way, at - compile time, to detect the difference. The standard resolved a number - of defect reports and slightly expanded value initialization. Most - compilers support it the same as C++98.</p> - </dd> - <dt id="__cplusplus~3">ISO/IEC 14882:2011 ("C++11")</dt> - <dd><a class="permalink" href="#__cplusplus~3"><code class="Dv">__cplusplus = - 201103</code></a></dd> - <dt id="__cplusplus~4">ISO/IEC 14882:2014 ("C++14")</dt> - <dd><a class="permalink" href="#__cplusplus~4"><code class="Dv">__cplusplus = - 201402</code></a></dd> - <dt id="__cplusplus~5">ISO/IEC 14882:2017 ("C++17")</dt> - <dd><a class="permalink" href="#__cplusplus~5"><code class="Dv">__cplusplus = - 201703</code></a></dd> - <dt id="__cplusplus~6">ISO/IEC 14882:2020 ("C++20")</dt> - <dd><a class="permalink" href="#__cplusplus~6"><code class="Dv">__cplusplus = - 202002</code></a></dd> - <dt id="__cplusplus~7">ISO/IEC 14882:2023 ("C++23")</dt> - <dd><a class="permalink" href="#__cplusplus~7"><code class="Dv">__cplusplus = - 202302</code></a></dd> -</dl> -<p class="Pp"><span class="Ux">FreeBSD</span> uses llvm project's libc++. - However, they are removing support for C++ prior to C++11. While programs - can still build with earlier environments for now, these changes mean that - <code class="Fl">-pedantic-errors</code> cannot be reliably enabled for - standards older than C++11.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> -<p class="Pp"><code class="In"><<a class="In">sys/cdefs.h</a>></code> - first appeared in <span class="Ux">4.3BSD-NET/2</span>.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">May 9, 2025</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> |
