This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for void foo(const void) and similar
- To: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Subject: Re: Patch for void foo(const void) and similar
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 31 Jul 2000 07:12:00 -0600
- cc: gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <Pine.SOL.4.21.0007301446210.11-100000@red.csi.cam.ac.uk>you write
:
> When a parameter list of 'void' alone is used to signify no parameters
> to a function in C, it makes no sense for the 'void' to be qualified
> or to have a storage class specifier, and such cases aren't covered by
> the definition of this handling of 'void' in the standard. The
> informative list of undefined behavior in C99 includes this (undefined
> through the lack of any definition of the significance of qualified
> void parameters or of storage class specifiers applied to such). This
> patch converts such cases into errors by not treating them as the
> special case of 'void' alone in a parameter list.
>
> (Other type qualifiers (restrict) already get errors when applied to
> void; other storage class specifiers than register (auto, extern,
> static) already get errors when used in a parameter list.)
>
> Bootstrapped with no regressions on i686-pc-linux-gnu.
>
> gcc/ChangeLog:
> 2000-07-30 Joseph S. Myers <jsm28@cam.ac.uk>
>
> * c-decl.c (get_parm_info): Don't treat 'const void', 'volatile
> void' or 'register void' as being the special case of 'void' alone
> in a parameter list.
>
> gcc/testsuite/ChangeLog:
> 2000-07-30 Joseph S. Myers <jsm28@cam.ac.uk>
>
> * gcc.dg/noncompile/voidparam-1.c: New test.
Thanks. Installed.
jeff