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]

Re: Patch for void foo(const void) and similar



  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


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