Article View: comp.lang.c
Article #711Re: variadic min and max, (any some and none, cat and more)
From: fir
Date: Fri, 23 Oct 2026 12:57
Date: Fri, 23 Oct 2026 12:57
53 lines
2442 bytes
2442 bytes
fir pisze:
> David Brown pisze:
>> Variadic functions have no way of counting their arguments, or
>> identifying their types.
>
>
> this is silly becouse it cos t one register to use so its totally not a
> problem
>
>
> the case with various type arguments is much harder but the one with
> "all ints" etc is quite easy
>
>
> simpl as i said the user need the arg[] and arg_max avaliable
>
>
> foo(int ...v)
> {
> Β for(int i=0; i<sizeof(v)/sizeof(int); i++)
> {
>
> }
>
> }
>
so as its show in this all one type case you dont need any varargs macros
foo (int n, ...) {}
in fact you dont need nothing may just acces via n[i] above all you need
it to pass in register the max_n value (or size of args block)
> i dont know maybe just same syntax can be used
>
> foo(int[] v)
> {
>
> }
>
> so you can put foo(tab) or foo(2,3,4,2,32,3,23,2) at will
> thou this version would pass via pointer and is someone need to pass by
> stack probably would need to use f(int ...)Β version
>
Technical Details
Message-ID:
<11bflk6$1qchd$1@dont-email.me>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!.POSTED!not-for-mailReferences:
<11bes8b$1gncr$1@dont-email.me> <11bf84v$1jkb5$1@dont-email.me> <11bfko4$1q1en$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!.POSTED!not-for-mail From: fir <profesor.fir@gmail.com> Newsgroups: comp.lang.c Subject: Re: variadic min and max, (any some and none, cat and more) Date: Fri, 23 Oct 2026 14:57:41 +0200 Organization: A noiseless patient Spider Lines: 53 Message-ID: <11bflk6$1qchd$1@dont-email.me> References: <11bes8b$1gncr$1@dont-email.me> <11bf84v$1jkb5$1@dont-email.me> <11bfko4$1q1en$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 23 Oct 2026 12:57:42 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1913389"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xOZ7G820LFbrjG6i00IHoRk4yXTmno0U="; posting-host="43cad3fa7698c2e9be359f2072ea7249" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0 SeaMonkey/2.53.24 Cancel-Lock: sha1:PiGUwa5VP8yHCLH7Ovli0kJaBSg= sha256:6HrJQb5xVj1HJR2nElakLARH8Ot/lEtaJMeCQ0rx1QQ= sha1:Qf97uWoomKAvqrfnJ30+tIAxa5o= sha256:bC4aep8jf1kAwaXKL29bidw6KhHEx03pN0n18sPFdNs= In-Reply-To: <11bfko4$1q1en$1@dont-email.me>