]> git.ipfire.org Git - thirdparty/gcc.git/commit
c: Don't pedwarn on _FloatN{,x} or {f,F}N{,x} suffixes for C2X
authorJakub Jelinek <jakub@redhat.com>
Wed, 6 Sep 2023 06:51:00 +0000 (08:51 +0200)
committerJakub Jelinek <jakub@redhat.com>
Wed, 6 Sep 2023 06:51:00 +0000 (08:51 +0200)
commit80acabb6dd05090db67805cdd358fe974b45e2ed
treebe4175443b119ebe0736004381f6e4bd5efc7d75
parentc1597e7fb9f9ecb9d7c33b5afa48031f284375de
c: Don't pedwarn on _FloatN{,x} or {f,F}N{,x} suffixes for C2X

Now that _Float{16,32,64,128,32x,64x,128x} and
{f,F}{16,32,64,128,32x,64x,128x} literal suffixes are in C23 standard,
I think it is undesirable to pedwarn about these for -std=c2x, so this
patch uses pedwarn_c11 instead.  In c-family/, we don't have that function
and am not sure it would be very clean to define dummy pedwarn_c11 in the
C++ FE, so the patch just does what pedwarn_c11 does using pedwarn/warning.

2023-09-06  Jakub Jelinek  <jakub@redhat.com>

gcc/c-family/
* c-lex.cc (interpret_float): For C diagnostics on FN and FNx suffixes
append " before C2X" to diagnostics text and follow behavior of
pedwarn_c11.
gcc/c/
* c-decl.cc (declspecs_add_type): Use pedwarn_c11 rather than pedwarn
for _FloatN{,x} diagnostics and append " before C2X" to the diagnostic
text.
gcc/testsuite/
* gcc.dg/c11-floatn-1.c: New test.
* gcc.dg/c11-floatn-2.c: New test.
* gcc.dg/c11-floatn-3.c: New test.
* gcc.dg/c11-floatn-4.c: New test.
* gcc.dg/c11-floatn-5.c: New test.
* gcc.dg/c11-floatn-6.c: New test.
* gcc.dg/c11-floatn-7.c: New test.
* gcc.dg/c11-floatn-8.c: New test.
* gcc.dg/c2x-floatn-1.c: New test.
* gcc.dg/c2x-floatn-2.c: New test.
* gcc.dg/c2x-floatn-3.c: New test.
* gcc.dg/c2x-floatn-4.c: New test.
* gcc.dg/c2x-floatn-5.c: New test.
* gcc.dg/c2x-floatn-6.c: New test.
* gcc.dg/c2x-floatn-7.c: New test.
* gcc.dg/c2x-floatn-8.c: New test.
18 files changed:
gcc/c-family/c-lex.cc
gcc/c/c-decl.cc
gcc/testsuite/gcc.dg/c11-floatn-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c11-floatn-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c11-floatn-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c11-floatn-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c11-floatn-5.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c11-floatn-6.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c11-floatn-7.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c11-floatn-8.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c2x-floatn-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c2x-floatn-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c2x-floatn-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c2x-floatn-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c2x-floatn-5.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c2x-floatn-6.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c2x-floatn-7.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c2x-floatn-8.c [new file with mode: 0644]