This is the mail archive of the gcc-patches@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]

[PATCH] Fix PR c/6326


Hello,

The attached patch implements the behaviour required by ISO C99.
Note that I didn't check the reference provided by the submitter
because I don't have the ISO C99 standard at hand.

Bootstrapped/regtested (C/C++) on i586-pc-linux-gnu.


2002-05-01  Eric Botcazou  <ebotcazou@multimania.com>

    PR c/6326
    * c-decl.c (grokparms): turn an empty parameter
    list into a (void) list in a function definition
    if speaking ISO C99.


/* PR c/6326 */
/* { dg-do compile } */
/* { dg-options "-std=c99" } */

/* Verify that GCC interprets an empty parameter list
   in a function definition as a (void) list. */

void foo()
{
}

void bar(void)
{
  foo(1); /* { dg-error "too many arguments" } */
}

void foo2();

void bar2(void)
{
  foo2(1); /* ok */
}

--
Eric Botcazou
ebotcazou@multimania.com

Attachment: c-decl.diff
Description: Binary data


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