🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1835

Re: Bug in gcc 1.26: ansi prototypes

#1835
From: Ken Raeburn
Date: Thu, 20 Oct 1988 10:30
22 lines
1293 bytes
No, this is not a bug.  As the documentation should describe, the
dpANS specifies that a function definition of the form:

	int foo (x)
		char x;
	{
		/* ... */
	}

means that an argument of type int is passed, and is treated as a char
within the function.  Similar promotions occur if the argument is
declared as type "short".  This means that you are defining a function
which would only be compatible with the "int" prototype (or no
prototype at all).

The type is not being converted in the prototype, as you suspected,
but in the function definition, because it is using an "old-style"
(non-prototype) format.  Since the definition comes after the
prototype declaration, this is where the error is reported.  It could
be argued that the error should be reported on the line containing the
prototype; it could also be argued that it's good enough as it is.
Technical Details
Message-ID: <8810201030.AA16286@OLIVER.MIT.EDU>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!ATHENA.MIT.EDU!raeburn

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!ATHENA.MIT.EDU!raeburn
From: raeburn@ATHENA.MIT.EDU (Ken Raeburn)
Newsgroups: gnu.gcc.bug
Subject: Re: Bug in gcc 1.26: ansi prototypes
Message-ID: <8810201030.AA16286@OLIVER.MIT.EDU>
Date: 20 Oct 88 10:30:29 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 21