🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1783

Re: spurious argument mismatch message?

#1783
From: Dave Hanson
Date: Tue, 11 Oct 1988 21:40
20 lines
1348 bytes
In article <8810102002.AA19547@troy.frame.com> frame!troy!drf@SUN.COM (David Fuchs) writes:
	The following file, compiled with no flags, with GNU-CC version 1.28, gives
	
	          foo.c:5: argument `parm' doesn't match function prototype
	
	which appears to be spurious.  Perhaps there is some question about the
	what it means to use function prototypes even when the function itself
	is declared with "old" syntax;

	void foo(short); /* Prototype */
	
	void foo(parm) /* Actual */
	short parm; {}

this isn't a spurious error; it's correct.
the problem is that the definition is given in `old-style'.
hence, default argument promotions apply, which cause actual
arguments to be promoted to int. thus, the `inferred prototype'
given by the definition is `void foo(int)', which conflicts
with the prototype given explicitly.
Technical Details
Message-ID: <12534@princeton.Princeton.EDU>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!mailrus!cornell!rochester!udel!princeton!notecnirp!drh
References: <8810102002.AA19547@troy.frame.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!mailrus!cornell!rochester!udel!princeton!notecnirp!drh
From: drh@notecnirp.Princeton.EDU (Dave Hanson)
Newsgroups: gnu.gcc.bug
Subject: Re: spurious argument mismatch message?
Message-ID: <12534@princeton.Princeton.EDU>
Date: 11 Oct 88 21:40:27 GMT
References: <8810102002.AA19547@troy.frame.com>
Sender: news@princeton.Princeton.EDU
Reply-To: drh@notecnirp.UUCP (Dave Hanson)
Organization: Dept. of Computer Science, Princeton University
Lines: 20