https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91980

            Bug ID: 91980
           Summary: No diagnostic for type "complex"
           Product: gcc
           Version: 8.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Keith.S.Thompson at gmail dot com
  Target Milestone: ---

"gcc -std=c11 -pedantic-errors" does not issue a required
diagnostic for a declaration using type "complex". The
C standard requires "float _Complex", "double _Complex", or
"long double _Complex" (or equivalent; the keywords can be
in any order and "_Complex" can be replaced by "complex"
if <complex.h> is included).
See C11/N1570 6.7.1 "Type specifiers"

Test case "complex-bug.c":
========================================
#include <complex.h>
complex x;
// _Complex y;
========================================

The command
    gcc -std=c11 -pedantic-errors -c complex-bug.c
produces no diagnostics for this source file.

Further experiments, not shown here, indicate that
x is of type double _Complex.

If the declaration of "y" is uncommented, a diagnostic
is issued:
========================================
complex-bug.c:3:1: error: ISO C does not support plain ‘complex’ meaning
‘double complex’ [-Wpedantic]
 _Complex y;
 ^~~~~~~~
========================================

("complex" and "_Complex" should be treated identically.)

I've reproduced this problem with gcc 8.3.0 on Ubuntu 19.04
and with 10.0.0 20190916 (experimental) (built from source)
on Ubuntu 18.04.3.

Reply via email to