c-family: Support DFP printf/scanf formats for C2X
authorJoseph Myers <joseph@codesourcery.com>
Thu, 14 Oct 2021 20:56:29 +0000 (20:56 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 14 Oct 2021 20:56:29 +0000 (20:56 +0000)
commit04a9b8d2f38573d0527edeea9e4fd9b7dfdc7983
tree978d0418c6fd25978f46c0b669019b4940a87448
parentb7561b5d2443f1d5f54f5177f0fb1a13c4205856
c-family: Support DFP printf/scanf formats for C2X

When I enabled various decimal floating-point features for C2X /
stopped them being diagnosed with -pedantic for C2X, I missed the
format checking support.  The DFP printf and scanf formats are
included in C2X.  Thus, adjust the data for those formats so that they
are no longer diagnosed with -std=c2x -Wformat -pedantic.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

gcc/c-family/
* c-format.c (printf_length_specs, scanf_length_specs)
(print_char_table, scan_char_table): Support DFP formats for C2X.
* c-format.h (TEX_D32, TEX_D64, TEX_D128): Remove.
(T2X_D32, T2X_D64, T2X_D128): New macros.

gcc/testsuite/
* gcc.dg/format/c11-dfp-printf-1.c,
gcc.dg/format/c11-dfp-scanf-1.c, gcc.dg/format/c2x-dfp-printf-1.c,
gcc.dg/format/c2x-dfp-scanf-1.c: New tests.
gcc/c-family/c-format.c
gcc/c-family/c-format.h
gcc/testsuite/gcc.dg/format/c11-dfp-printf-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/format/c11-dfp-scanf-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/format/c2x-dfp-printf-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/format/c2x-dfp-scanf-1.c [new file with mode: 0644]