This is the mail archive of the gcc@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: GCC 3.0 Branch: Guidelines


>-----Original Message-----
>From: Neil Booth [mailto:neil@daikokuya.demon.co.uk]
>Sent: 13 March 2001 19:38


>>[SNIP]
>> - gcc only produces a warning when you return a value from a 
>void function
>
>I agree these should both be errors.

  The thing about returning a value from a void function should 
probably still be allowed under -traditional, since it's just the flip
side of the coin compared to not returning a value from a non-void
function.  K&R C permitted this practice, and the return value of the
function would generally correspond to whatever was calculated by the
last expression evaluated before the function returned.  So before 
completely killing the option it might be relevant to consider what
would happen in an old K&R C program that had something like :

void foo (void)
{
   ...
  return value;
}

int bar (void)
{
   ...
  foo ();
  return;
}


         DaveK
-- 
 All your base are belong to us!


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


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