🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2388

Function type compatibility and the ellipsis

#2388
From: J. Stephen Adamczyk
Date: Sat, 09 Feb 1991 01:26
21 lines
1111 bytes
Is the following program legal?

int f(int a, ...);
int f(a) int a; { return 0; }

The rules for function type compatibility in 3.5.4.3 say that

"If one type has a parameter type list and the other type is
specified by a function definition that contains a (possibly
empty) identifier list, both shall agree in the number of
parameters, and the type of each prototype parameter shall
be compatible with the type that results from the
application of the default argument promotions to the type
of the corresponding identifier."

Note that of the three cases discussed in the paragraph, only
this one fails to mention an ellipsis compatibility requirement.
An oversight?  An intentional omission?

Steve Adamczyk (jsa@edg.com or uunet!edg1!jsa; 201-744-2620)
Technical Details
Message-ID: <947@edg1.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!edg1!jsa

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!edg1!jsa
From: jsa@edg1.UUCP (J. Stephen Adamczyk)
Newsgroups: comp.std.c
Subject: Function type compatibility and the ellipsis
Message-ID: <947@edg1.UUCP>
Date: 9 Feb 91 01:26:51 GMT
Organization: Edison Design Group Inc., Upper Montclair, NJ
Lines: 21