]> git.ipfire.org Git - thirdparty/gcc.git/commit
c: Handle C23 floating constant {d,D}{32,64,128} suffixes like {df,dd,dl}
authorJakub Jelinek <jakub@redhat.com>
Wed, 13 Nov 2024 08:44:20 +0000 (09:44 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 13 Nov 2024 08:44:20 +0000 (09:44 +0100)
commit856809e582bacbceb70cdae56feb86da367f379e
treecc311f08db7c3dfa52160e5047db450299f7d1ad
parenteb45d151fa1780d01533d9fc9545fec50bfd7152
c: Handle C23 floating constant {d,D}{32,64,128} suffixes like {df,dd,dl}

C23 roughly says that {d,D}{32,64,128} floating point constant suffixes
are alternate spellings of {df,dd,dl} suffixes in annex H.

So, the following patch allows that alternate spelling.
Or is it intentional it isn't enabled and we need to do everything in
there first before trying to define __STDC_IEC_60559_DFP__?
Like add support for _Decimal32x and _Decimal64x types (including
the d32x and d64x suffixes) etc.

2024-11-13  Jakub Jelinek  <jakub@redhat.com>

libcpp/
* expr.cc (interpret_float_suffix): Handle d32 and D32 suffixes
for C like df, d64 and D64 like dd and d128 and D128 like
dl.
gcc/c-family/
* c-lex.cc (interpret_float): Subtract 3 or 4 from copylen
rather than 2 if last character of CPP_N_DFLOAT is a digit.
gcc/testsuite/
* gcc.dg/dfp/c11-constants-3.c: New test.
* gcc.dg/dfp/c11-constants-4.c: New test.
* gcc.dg/dfp/c23-constants-3.c: New test.
* gcc.dg/dfp/c23-constants-4.c: New test.
gcc/c-family/c-lex.cc
gcc/testsuite/gcc.dg/dfp/c11-constants-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/dfp/c11-constants-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/dfp/c23-constants-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/dfp/c23-constants-4.c [new file with mode: 0644]
libcpp/expr.cc