cproc implements some C23 features applied to the latest drafts.
_Static_assert
without messageC11 required that static assertions always contained a message. C23
now allows _Static_assert
with just an expression.
C23 introduces UTF-8 character constants using the syntax u8'a'
.
Compared to an unprefixed character constant, they have type unsigned char
instead of int
, and are guaranteed to use UTF-8 encoding
rather than the execution character set. Since the character in a
UTF-8 character constant must have a single-byte UTF-8 encoding,
this type of character constant could be useful when you need the
ASCII value of a character, but do not want to depend on any
particular execution character set.
In previous revisions of C, labels like foo:
, case 123:
, or
default:
could only precede statements. This was relaxed in C23,
and they can now appear intermixed with declarations in compound
statements.
C23 allows you to omit the name of a parameter in the prototype of a function definition that does not use that parameter.
C23 allows binary integer constants in addition to octal, decimal,
and hexadecimal, using syntax like 0b01101011
.
C23 allows empty initializers to initialize an object as if it had static storage duration.
commit 4fa48e716d6381e51ae8dc7a9992c4c7d50219a1 Author: Michael Forney <mforney@mforney.org> Date: 2022-06-27T13:11:50-07:00 qbe: Insert dead block when compiling unreachable code after a jump QBE will optimize out these blocks, and the dead block prevents the possibility of NULL value usage when further control flow follows. Fixes #80.