]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man3/[static_]assert.3: SYNOPSIS: Use 'bool' instead of 'scalar'
authorAlejandro Colomar <alx@kernel.org>
Thu, 8 May 2025 10:29:59 +0000 (12:29 +0200)
committerAlejandro Colomar <alx@kernel.org>
Thu, 8 May 2025 10:30:01 +0000 (12:30 +0200)
The type _Bool perfectly models these APIs.  Conversion from any scalar
type to _Bool results in true if the value is non-zero, and false if it
is zero.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man3/assert.3
man/man3/static_assert.3

index 9a08b07ea4637f89523070a5f6e34b3b2e66af74..bb7f5dfc3c0a680bc2d7a59197bb97a2ebe63c3e 100644 (file)
@@ -13,7 +13,7 @@ Standard C library
 .nf
 .B #include <assert.h>
 .P
-.BI "void assert(scalar " expression );
+.BI "void assert(bool " expression );
 .fi
 .SH DESCRIPTION
 This macro can help programmers find bugs in their programs,
@@ -76,7 +76,8 @@ In C89,
 .I expression
 is required to be of type
 .I int
-and undefined behavior results if it is not, but in C99
+and undefined behavior results if it is not,
+but in C99
 it may have any scalar type.
 .\" See Defect Report 107 for more details.
 .SH BUGS
index ca79ce07e7c909a68139b7ae565fbc2202b58600..47c497bff5286ff23971b9a47a59c10f4cd087d1 100644 (file)
@@ -12,10 +12,10 @@ Standard C library
 .nf
 .B #include <assert.h>
 .P
-.BI "void static_assert(scalar " constant-expression ", const char *" msg );
+.BI "void static_assert(bool " constant-expression ", const char *" msg );
 .P
 /* Since C23: */
-.BI "void static_assert(scalar " constant-expression );
+.BI "void static_assert(bool " constant-expression );
 .fi
 .SH DESCRIPTION
 This macro is similar to