[clang] Binary literals are flagged as a GNU extension even when compiling in C23 mode (original) (raw)

C23 added binary literals into the standard, but currently, when compiling with -std=c23 -Wpedantic, the compiler emits a warning (-Wgnu-binary-literal) that they're a GNU extension.

Reproducing the error

Compile the following program with clang -std=c23 -Wpedantic:

int main() { return 0b0; }

Here's that program in Compiler Explorer, compiled with Clang trunk: https://godbolt.org/z/Ezz6ox37x.

Expected behaviour

The program should compile with no warnings.

Possible solution

Don't enable -Wgnu-binary-literal as part of -Wpedantic when compiling as C23.