[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#948490: gcc-9: -std=c11 prevents the use of decimal FP



Package: gcc-9
Version: 9.2.1-22
Severity: normal

The -std=c11 option (or other versions of the C standard) prevents
the use of decimal FP:

$ cat tst.c
int main (void)
{
  _Decimal64 x = 1;
  return x != 1;
}
$ gcc-9 tst.c -o tst
$ gcc-9 -std=c11 tst.c -o tst
tst.c: In function ‘main’:
tst.c:3:3: error: unknown type name ‘_Decimal64’
    3 |   _Decimal64 x = 1;
      |   ^~~~~~~~~~

There is no such issue with gcc-snapshot (_Decimal64 is not a
forbidden extension):

$ gcc-snapshot -std=c11 tst.c -o tst
$ gcc-snapshot -std=c11 -pedantic tst.c -o tst
tst.c: In function 'main':
tst.c:3:3: warning: ISO C does not support decimal floating-point before C2X [-Wpedantic]
    3 |   _Decimal64 x = 1;
      |   ^~~~~~~~~~

The GCC 9.2.0 manual does not mention a possible limitation.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.4.0-2-amd64 (SMP w/12 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=POSIX (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages gcc-9 depends on:
ii  binutils      2.33.50.20200107-1
ii  cpp-9         9.2.1-22
ii  gcc-9-base    9.2.1-22
ii  libc6         2.29-8
ii  libcc1-0      9.2.1-22
ii  libgcc-9-dev  9.2.1-22
ii  libgcc1       1:9.2.1-22
ii  libgmp10      2:6.1.2+dfsg-4
ii  libisl22      0.22-2
ii  libmpc3       1.1.0-1
ii  libmpfr6      4.0.2-1
ii  libstdc++6    9.2.1-22
ii  zlib1g        1:1.2.11.dfsg-1+b1

Versions of packages gcc-9 recommends:
ii  libc6-dev  2.29-8

Versions of packages gcc-9 suggests:
ii  gcc-9-doc       9.2.0-2
ii  gcc-9-locales   9.2.1-22
ii  gcc-9-multilib  9.2.1-22

-- no debconf information


Reply to: