This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c/6559: "-std=c99 -pedantic" displays c89 warning



>Number:         6559
>Category:       c
>Synopsis:       "-std=c99 -pedantic" displays c89 warning
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 04 10:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Erik Schnetter
>Release:        3.0.4
>Organization:
>Environment:
SuSE Linux 7.3
>Description:
I have a function using a variable sized array.  This function is legal in C99, but not legal in C89.  When I compile with

~/gcc/bin/gcc -std=c99 -pedantic -c c99ped.c

then I receive the warning

c99ped.c: In function `c99ped':
c99ped.c:3: warning: ISO C89 forbids variable-size array `x'

I think that this warning should not be there, because I explicitely selected the C99 standard.  In this case, I want -pedantic to warn only about violations of the C99 standard.



My source code is the four lines of

void c99ped (int dim)
{
  double (* x)[dim];
}

$ ~/gcc/bin/gcc --version
3.0.4
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]