🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #751

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

#751
From: Keith Thompson
Date: Sun, 25 Oct 2026 02:24
49 lines
3171 bytes
bartc <bc@freeuk.com> writes:
> On 25/10/2026 00:34, Keith Thompson wrote:
>> bartc <bc@freeuk.com> writes:
>> [...]
>>> Still talking about variadic functions? Then in C it's more
>>> restricted: variadic arguments will be, or be promoted to, one of:
>>>
>>> * Integer (typically one of i32 u32 i64 u64)
>>>
>>> * Float (typically f64)
>>>
>>> * Pointer
>>>
>>> * Struct
>>>
>>> The last is more variable, but on modern ABIs, a struct that isn't one
>>> of certain set of patterns will be passed by pointer. (I don't know
>>> how _BitInt are handled.)
>> [...]
>> That's an odd and incomplete way to state the rules (and you
>> missed unions).
>
> They will be grouped with structs.

Will they be?  By whom?  I don't know what that even means.

Perhaps you just forgot about unions -- which would be perfectly
understandable.

>> A variadic argument of an integer type narrower than int is promoted
>> to int or unsigned int (int if int holds all possible values of the
>> source type, otherwise unsigned int).  These "integer promotions"
>> do not apply to _BitInt types.  A variadic argument of type float is
>> promoted to double.  All other argument types are not promoted --
>> though the usual array-to-pointer and function-to-pointer conversions
>> are applied.
>
> The list represented variadic argument types after promotions. It was
> anywhere summarising existing variadic functions as it wasn't clear to
> which kinds Mr .bleu was referring to.

I'm not at all sure what you mean.

You posted an incomplete summary of the promotion rules.  I posted an
accurate summary of the promotion rules.

-- 
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: <11bjp8s$38c65$1@kst.eternal-september.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!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> <11bf84v$1jkb5$1@dont-email.me> <11bfdcs$1mvrv$1@dont-email.me> <11bi1pg$2ke58$2@dont-email.me> <11bi3bf$2l005$1@dont-email.me> <11bjf9d$35feb$2@kst.eternal-september.org> <11bjmml$37qje$1@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!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 19:24:28 -0700
Organization: None to speak of
Lines: 49
Message-ID: <11bjp8s$38c65$1@kst.eternal-september.org>
References: <11bes8b$1gncr$1@dont-email.me> <11bf84v$1jkb5$1@dont-email.me>
	<11bfdcs$1mvrv$1@dont-email.me> <11bi1pg$2ke58$2@dont-email.me>
	<11bi3bf$2l005$1@dont-email.me>
	<11bjf9d$35feb$2@kst.eternal-september.org>
	<11bjmml$37qje$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sun, 25 Oct 2026 02:24:29 +0000 (UTC)
Injection-Info: kst.eternal-september.org;
	logging-data="3420357"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19iZZR/k2J7+cAJxEpZWdiA"; posting-host="dffc63d453f8c8b2272cd17e24475421"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:A29Uibpm7Abw/0XFGVmI/HbLdtE= sha256:azzHNILseqwCAGZ/1cWHf7Xh1mPCCe8KcaCiO7ALCF4=
	sha1:ojv1NtmY/s+vVOYLGnRa0rz9YFc= sha256:BjZCOCmrhg3/KXFmLQ7CNB8k4ICa9vT5X6VCllIN9ZI=