🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #747

Re: variadic min and max, (any some and none, cat and more)

#747
From: Keith Thompson
Date: Sat, 24 Oct 2026 23:24
26 lines
2431 bytes
"chine.bleu" <chine.bleu@yahoo.com> writes:
[...]
> The compiler cannot be certain which function calls are variadic. Old
> style function declarations are allowed which provide no information
> about arguments. You cannot change this without breaking unknown
> amount of dusty old code.

Yes, it can.

In C90, if you call a variadic function, the prototype with `, ...`
must be visible at the point of the call.  If the visible declaration
is a non-variadic prototype, or not a prototype, or nonexistent,
the compiler treats it as a non-variadic call.  If the call and
declaration are inconsistent with the actual definition, the
behavior is undefined.

In C99, calls with no visible declaration were made constraint
violations.

In C23, old-style function declarations were removed.  A visible
prototype is always required, and a prototype always indicates
whether the function is variadic or not.

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Technical Details
Message-ID: <11bjemv$35feb$1@kst.eternal-september.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!nntp.club.cc.cmu.edu!37.252.120.71.MISMATCH!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!kst.eternal-september.org!.POSTED!not-for-mail
References: <11bes8b$1gncr$1@dont-email.me> <11bi11u$2k5ua$2@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!nntp.club.cc.cmu.edu!37.252.120.71.MISMATCH!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!kst.eternal-september.org!.POSTED!not-for-mail
From: Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: variadic min and max, (any some and none, cat and more)
Date: Sat, 24 Oct 2026 16:24:00 -0700
Organization: None to speak of
Lines: 26
Message-ID: <11bjemv$35feb$1@kst.eternal-september.org>
References: <11bes8b$1gncr$1@dont-email.me> <11bi11u$2k5ua$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sat, 24 Oct 2026 23:24:15 +0000 (UTC)
Injection-Info: kst.eternal-september.org;
	logging-data="3325387"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18Cd2fbpzHQbxCY9RqHGZqH"; posting-host="a31d234860135fde93726068e77d5277"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:HxFG5mxC31Wkq0TBNhJ0g4zOOmc= sha256:j1aoLs6BSA4KcUojCG8u0SYbVQWjfP81AujpBpeS7yo=
	sha1:yAAQi+FZhvd2We6r/OnMTzJ0zhg= sha256:DHJWfiblshRi45U6+X8Ktsri+aY6O9/LY+/ydAFfSmY=
X-Received-Bytes: 2184