This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: GCC 3.0 Branch: Guidelines
- To: 'Joe Buck' <jbuck at synopsys dot COM>
- Subject: RE: GCC 3.0 Branch: Guidelines
- From: David Korn <dkorn at pixelpower dot com>
- Date: Wed, 14 Mar 2001 17:05:41 -0000
- Cc: gcc at gcc dot gnu dot org
>-----Original Message-----
>From: Joe Buck [mailto:jbuck@synopsys.COM]
>Sent: 14 March 2001 16:43
>I go back far enough to have perused the V7 Unix sources (I briefly
>used version 6 as well). I know how C used to be written.
That is indeed a long time!
>The standard way to write a void function, pre-void, was not to name
>a return type at all, e.g.
>
>foo() {
> do_something();
>}
>
>But if the user says "void", s/he has made a specific statement: this
>function does not return a value. There is no symmetry here.
I guess it just seemed symmetrical to me because I saw that case as being
an instance of failing to return a value from a function that should return
an (implicit) int, rather than seeing it (as it seems you do) as not
returning a value from a function that is not declared to return a
function.
>Even in K&R days, a user who explicitly declared a function void would not
>purposely try to return a value from such a function!
Point taken.
> The reason is that (void) was not added until prototypes were added.
D'oh. Forgot that. I guess functions that didn't explicitly declare a
return type weren't regarded as returning an implicit int until that stage
either, which might explain why what seemed symmetry to me wasn't actually
so. I appear to have been guilty of some major anachronisms!
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
**********************************************************************