Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

You might have mail.


devel / comp.lang.c / Re: Variadic functions

SubjectAuthor
* Variadic functionsMalcolm McLean
+- Re: Variadic functionsKaz Kylheku
+- Re: Variadic functionsKeith Thompson
+- Re: Variadic functionsLawrence D'Oliveiro
+- Re: Variadic functionsJames Kuyper
+* Re: Variadic functionsJanis Papanagnou
|`* Re: Variadic functionsMalcolm McLean
| +* Re: Variadic functionsSpiros Bousbouras
| |+* Re: Variadic functionsMalcolm McLean
| ||`- Re: Variadic functionsRichard Harnden
| |`* Re: Variadic functionsBlue-Maned_Hawk
| | `* Re: Variadic functionsLawrence D'Oliveiro
| |  +* Re: Variadic functionsMalcolm McLean
| |  |+- Re: Variadic functionsDavid Brown
| |  |`* Re: Variadic functionsScott Lurndal
| |  | +* Re: Variadic functionsLawrence D'Oliveiro
| |  | |`* Re: Variadic functionsDavid Brown
| |  | | +* Re: Variadic functionsJanis Papanagnou
| |  | | |`- Re: Variadic functionsDavid Brown
| |  | | +* Re: Variadic functionsLawrence D'Oliveiro
| |  | | |`* Re: Variadic functionsDavid Brown
| |  | | | `* Re: Variadic functionsLawrence D'Oliveiro
| |  | | |  `* Re: Variadic functionsKenny McCormack
| |  | | |   +- Re: Variadic functionsKaz Kylheku
| |  | | |   `- Re: Variadic functionsLawrence D'Oliveiro
| |  | | `* Re: Variadic functionsMalcolm McLean
| |  | |  +- Re: Variadic functionsKaz Kylheku
| |  | |  +- Re: Variadic functionsJames Kuyper
| |  | |  +- Re: Variadic functionsDavid Brown
| |  | |  `* Re: Variadic functionsKeith Thompson
| |  | |   `* Re: Variadic functionsMalcolm McLean
| |  | |    +* Re: Variadic functionsScott Lurndal
| |  | |    |+- Re: strings (was Re: Variadic functions)Lawrence D'Oliveiro
| |  | |    |`- Re: Variadic functionsDavid Brown
| |  | |    +* Re: Variadic functionsKaz Kylheku
| |  | |    |`- Re: Variadic functionsMalcolm McLean
| |  | |    `* Re: Variadic functionsDavid Brown
| |  | |     `* Re: Variadic functionsMalcolm McLean
| |  | |      `* Re: Variadic functionsDavid Brown
| |  | |       `* Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Lawrence D'Oliveiro
| |  | |        +- Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Chris M. Thomasson
| |  | |        +* Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)bart
| |  | |        |`* Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Lawrence D'Oliveiro
| |  | |        | +* Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)bart
| |  | |        | |`- Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Lawrence D'Oliveiro
| |  | |        | `* Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Tim Rentsch
| |  | |        |  `* Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Lawrence D'Oliveiro
| |  | |        |   +- Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Kaz Kylheku
| |  | |        |   `* Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Kenny McCormack
| |  | |        |    +- Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Kaz Kylheku
| |  | |        |    `- Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Lawrence D'Oliveiro
| |  | |        +- Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Kenny McCormack
| |  | |        +* Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Keith Thompson
| |  | |        |`* Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Lawrence D'Oliveiro
| |  | |        | `* Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Keith Thompson
| |  | |        |  +- Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Lawrence D'Oliveiro
| |  | |        |  `* Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)jak
| |  | |        |   `- Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)David Brown
| |  | |        +- Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)David Brown
| |  | |        `* Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Malcolm McLean
| |  | |         `* Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Chris M. Thomasson
| |  | |          `* Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)David Brown
| |  | |           `- Re: Bad String Functions; Bad Bad Bad (was Re: Variadic functions)Chris M. Thomasson
| |  | `* Re: Variadic functionsBlue-Maned_Hawk
| |  |  `* Re: Variadic functionsLawrence D'Oliveiro
| |  |   `* Re: Variadic functionsDavid Brown
| |  |    +* Re: Variadic functionsKaz Kylheku
| |  |    |+- Re: Variadic functionsScott Lurndal
| |  |    |+* Re: Variadic functionsKeith Thompson
| |  |    ||`* Re: Variadic functionsDavid Brown
| |  |    || `- Re: Variadic functionsKeith Thompson
| |  |    |+- Re: Variadic functionsJames Kuyper
| |  |    |`* Re: Variadic functionsDavid Brown
| |  |    | `* Re: Variadic functionsKeith Thompson
| |  |    |  `- Re: Variadic functionsDavid Brown
| |  |    +* Re: Variadic functionsLawrence D'Oliveiro
| |  |    |`- Re: Variadic functionsDavid Brown
| |  |    `* Re: Variadic functionsBlue-Maned_Hawk
| |  |     `- Re: Variadic functionsDavid Brown
| |  `- Re: Variadic functionsBlue-Maned_Hawk
| +* Re: Variadic functionsLawrence D'Oliveiro
| |`* Re: Variadic functionsMalcolm McLean
| | +- Re: Variadic functionsLawrence D'Oliveiro
| | +* Re: Variadic functionsbart
| | |+* Re: Variadic functionsMalcolm McLean
| | ||`* Re: Variadic functionsDavid Brown
| | || `* Re: Variadic functionsMalcolm McLean
| | ||  `* Re: Variadic functionsDavid Brown
| | ||   `* Re: Variadic functionsMalcolm McLean
| | ||    +* Re: Variadic functionsDavid Brown
| | ||    |`* Re: Variadic functionsMalcolm McLean
| | ||    | `* Re: Variadic functionsDavid Brown
| | ||    |  `* Re: Variadic functionsMalcolm McLean
| | ||    |   `- Re: Variadic functionsDavid Brown
| | ||    `* Re: Variadic functionsKaz Kylheku
| | ||     `* Re: Variadic functionsMalcolm McLean
| | ||      `- Re: Variadic functionsKaz Kylheku
| | |`- Re: Variadic functionsBlue-Maned_Hawk
| | +- Re: Variadic functionsKeith Thompson
| | `* Re: Variadic functionsLawrence D'Oliveiro
| |  `- Re: Variadic functionsKaz Kylheku
| `* Re: Variadic functionsLawrence D'Oliveiro
+* Re: Variadic functionsTim Rentsch
+- Re: Variadic functionsBlue-Maned_Hawk
`- Re: Variadic functionsChris M. Thomasson

Pages:12345
Re: Variadic functions

<uok3qh$coll$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32785&group=comp.lang.c#32785

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.furie.org.uk!nntp.terraraq.uk!news.gegeweb.eu!gegeweb.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: malcolm.arthur.mclean@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Sun, 21 Jan 2024 21:54:24 +0000
Organization: A noiseless patient Spider
Lines: 98
Message-ID: <uok3qh$coll$1@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <uohef2$3r4em$6@dont-email.me>
<uohhvs$3rpaa$1@dont-email.me> <uohjet$3s00n$1@dont-email.me>
<uoi0ea$3tmbi$1@dont-email.me> <uojgfu$87o7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 21 Jan 2024 21:54:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ef74072e6e16bb027db5ff5cce429f7f";
logging-data="418485"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/yZXxbInKHJqHsDvMbCvxBtRKR+k5YyHs="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:j8egPffTrurK5+zPAuOtZBQxFKk=
Content-Language: en-GB
In-Reply-To: <uojgfu$87o7$1@dont-email.me>
 by: Malcolm McLean - Sun, 21 Jan 2024 21:54 UTC

On 21/01/2024 16:24, David Brown wrote:
> On 21/01/2024 03:44, Malcolm McLean wrote:
>> On 20/01/2024 23:02, bart wrote:
>>> On 20/01/2024 22:37, Malcolm McLean wrote:
>>>> On 20/01/2024 21:37, Lawrence D'Oliveiro wrote:
>>>>> On Sat, 20 Jan 2024 11:19:57 +0000, Malcolm McLean wrote:
>>>>>
>>>>>> But no-one has yet come up with an occasion where they implemented a
>>>>>> variadic function by choice, for code which they controlled ...
>>>>>
>>>>> But the people who created these libraries we mentioned certainly did.
>>>>  >
>>>> I was wrong. As was pointed out eslewhere. Kaz gave some examples.
>>>> But his first was of usage.
>>>>
>>>> Of course someone must have taken the decision that the call to
>>>> evoke an external process would take a variable list of arguments
>>>> rather than a single string. However In find that, of thousands of
>>>> functions in my code base, not a single one is variadic except a few
>>>> interfaces to vsprintf.
>>>
>>>
>>> Variadic functions were likely added to implement *printf functions,
>>> since the language didn't want to make special provision just for those.
>>>
>>> Then a number of people decided to make use of the feature, although
>>> less often than you might expect.
>>>
>>> But it is not a desirable feature for general use as it is not
>>> type-safe.
>>>
>>> The other thing is, calling a variadic function is a lot easier than
>>> writing the body of one. That will likely put many off.
>>>
>>> I wouldn't be able to do it without looking up some examples.
>>>
>> I have occasionally passed the wrong type to printf. Usually a long
>> integer to %d. But I can't recall an occasion where the problem wasn't
>> quickly fixed. Xcode gives a warning for mismatched format string
>> parameters, but of course it can't do that for roll your own.
>
> Of course you can.
>
> XCode uses clang, IIUIC, and both gcc and clang have extensions
> (attributes) for checking printf and scanf style strings and the
> variadic parameters.  They only work with compile-time known format
> strings, understandably enough, but are fine for making your own checked
> functions for logging, debug prints, or whatever.
>
> That doesn't help for other types of variadic functions, however, and
> you they are never as type-safe as functions with full non-variadic
> prototypes.
>
>> The other thing is passing a raw pointer to %p instead of casting to
>> void *. Technically this is an error, but %p is only really useful for
>> temporary debug code, so it's just pointless typing to out the cast in.
>>
>> Variardic functions are implemented with macros and it's a bit hard to
>> work out what is going on. But it's not that hard. I don't think it's
>> a good reason for avoiding them. On the other hand, I implemented a
>> C++ variable length template expansion to produce a "simple JSON"
>> which is in effect a varidaic function with type information. But
>> whilst I implemented it myself, I can't remember exactly how it is
>> supposed to work or what the syntax means.
>>
>
> Variadic templates in C++ are typesafe, which is a big improvement over C.
>
>
A small improvement.

If you have type safety, it can be easier to know how to call the
function, because the system can help you by suggesting variables of the
right type and rejecting variables of the wrong type. And because the
type is often documentation about what the parameter means.

Then of course you can always create a bug by passing a varibale of the
wrong type.

But it's not a big improvement because, if you call a function at all,
you have to know what parameters it takes and what they mean anyway. And
whilst it does eliminate a bug, it's unlikely to be a dangerous bug, it
will usually be manifested very early and likely caught. So not the type
of thing that is likely to much effect on delivery time or quality of
the final product. However of course that won't always be the case,
especially if a long integer with all high bits zero happens to have the
same observable effect as the correct short integer or similar.

So there's a small advantage, but not a gamechanger.

My simpleJSON is variadic C++. But of course if you pass
"Nemployees",10.5, it will just create a JSON structure with a real
field value 10.5.

-- .
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Re: Variadic functions

<uokamq$dlua$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32791&group=comp.lang.c#32791

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Sun, 21 Jan 2024 23:51:55 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <uokamq$dlua$2@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <uoii8s$3jao$1@dont-email.me>
<uoj641$6io9$1@dont-email.me> <uok2cc$cgf7$3@dont-email.me>
<uok35h$ck24$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 21 Jan 2024 23:51:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="bfdaa5dc2469429165b2d062b928a109";
logging-data="448458"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX185c/XtviZ7hCeF9t+4XqkB"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:bYftPc/a9kF+p7/XHM+GAsTUFco=
 by: Lawrence D'Oliv - Sun, 21 Jan 2024 23:51 UTC

On Sun, 21 Jan 2024 21:43:13 +0000, bart wrote:

> On 21/01/2024 21:29, Lawrence D'Oliveiro wrote:
>> On Sun, 21 Jan 2024 13:27:30 +0000, bart wrote:
>>
>>> That is, the user-code in Python doesn't directly call 'stack_calc'.
>>> This means that there is no real need for the C function to be
variadic.
>>>
>>> It could take a single pointer to any arbitrary C data structure that
>>> can represent your sample expression. Or maybe two pointers to
parallel
>>> arrays. Or ...
>>
>> ... and be just as type-unsafe as the variadic option.
>
> No, it wouldn't.

Go on, then. Show us a typesafe alternative to printf, using your idea.

Re: Variadic functions

<uokbn5$dsas$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32792&group=comp.lang.c#32792

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Mon, 22 Jan 2024 00:09:08 +0000
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <uokbn5$dsas$1@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <uoii8s$3jao$1@dont-email.me>
<uoj641$6io9$1@dont-email.me> <uok2cc$cgf7$3@dont-email.me>
<uok35h$ck24$2@dont-email.me> <uokamq$dlua$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 22 Jan 2024 00:09:09 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e1e6f23a5b67b4655f7a372c9f27f255";
logging-data="455004"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18WFFYYuYQcY+Ba5JY1cgh3npLT/6JaYL0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:AzlJrXdhJg2V5RPQo0cJldtqFO4=
Content-Language: en-GB
In-Reply-To: <uokamq$dlua$2@dont-email.me>
 by: bart - Mon, 22 Jan 2024 00:09 UTC

On 21/01/2024 23:51, Lawrence D'Oliveiro wrote:
> On Sun, 21 Jan 2024 21:43:13 +0000, bart wrote:
>
>> On 21/01/2024 21:29, Lawrence D'Oliveiro wrote:
>>> On Sun, 21 Jan 2024 13:27:30 +0000, bart wrote:
>>>
>>>> That is, the user-code in Python doesn't directly call 'stack_calc'.
>>>> This means that there is no real need for the C function to be
> variadic.
>>>>
>>>> It could take a single pointer to any arbitrary C data structure that
>>>> can represent your sample expression. Or maybe two pointers to
> parallel
>>>> arrays. Or ...
>>>
>>> ... and be just as type-unsafe as the variadic option.
>>
>> No, it wouldn't.
>
> Go on, then. Show us a typesafe alternative to printf, using your idea.

I said your example didn't need the C function to be variadic. The point
of variadic is to be legally able to write, in C:

f(a) or f(a,b,c,d)

But your C function wasn't called from C, it isn't called from Python
user code. From inside your special function, I think it's called as
'func(*all_args)'.

It could easily be made to work with a non-variadic C function. But my
call to f() above either has to use a variadic function, or 'f' needs to
be declared with no parameter list:

void f(T, ...); // variadic
void f(); // unchecked arguments

Both are unsafe.

Re: Variadic functions

<uokct7$dvjv$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32793&group=comp.lang.c#32793

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Mon, 22 Jan 2024 00:29:27 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <uokct7$dvjv$1@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <uoii8s$3jao$1@dont-email.me>
<uoj641$6io9$1@dont-email.me> <uok2cc$cgf7$3@dont-email.me>
<uok35h$ck24$2@dont-email.me> <uokamq$dlua$2@dont-email.me>
<uokbn5$dsas$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 22 Jan 2024 00:29:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="bfdaa5dc2469429165b2d062b928a109";
logging-data="458367"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX195syeNEtu4olkGNj/yGdNh"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:uB34Vvv1Q19zwhcLuRgX/ibYdHw=
 by: Lawrence D'Oliv - Mon, 22 Jan 2024 00:29 UTC

On Mon, 22 Jan 2024 00:09:08 +0000, bart wrote:

> On 21/01/2024 23:51, Lawrence D'Oliveiro wrote:
>> On Sun, 21 Jan 2024 21:43:13 +0000, bart wrote:
>>
>>> On 21/01/2024 21:29, Lawrence D'Oliveiro wrote:
>>>> On Sun, 21 Jan 2024 13:27:30 +0000, bart wrote:
>>>>
>>>>> That is, the user-code in Python doesn't directly call 'stack_calc'.
>>>>> This means that there is no real need for the C function to be
>> variadic.
>>>>>
>>>>> It could take a single pointer to any arbitrary C data structure
>>>>> that can represent your sample expression. Or maybe two pointers to
>> parallel
>>>>> arrays. Or ...
>>>>
>>>> ... and be just as type-unsafe as the variadic option.
>>>
>>> No, it wouldn't.
>>
>> Go on, then. Show us a typesafe alternative to printf, using your idea.
>
> I said your example didn't need the C function to be variadic.

You also denied that your alternative would be less type-unsafe.

Re: Variadic functions

<uol77s$l3er$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32807&group=comp.lang.c#32807

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Mon, 22 Jan 2024 08:58:51 +0100
Organization: A noiseless patient Spider
Lines: 76
Message-ID: <uol77s$l3er$1@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <uohef2$3r4em$6@dont-email.me>
<uohhvs$3rpaa$1@dont-email.me> <uohjet$3s00n$1@dont-email.me>
<uoi0ea$3tmbi$1@dont-email.me> <uojgfu$87o7$1@dont-email.me>
<uok3qh$coll$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 22 Jan 2024 07:58:52 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="773b575d0a21626e330ecd5dcb685706";
logging-data="691675"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qPQOKjdNfGJ6veVmtIOi/bwuBWaVVn70="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:2Fi5fDrFhkYRc1NKex78rXvi/5I=
In-Reply-To: <uok3qh$coll$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Mon, 22 Jan 2024 07:58 UTC

On 21/01/2024 22:54, Malcolm McLean wrote:
> On 21/01/2024 16:24, David Brown wrote:
>> On 21/01/2024 03:44, Malcolm McLean wrote:

>>> Variardic functions are implemented with macros and it's a bit hard
>>> to work out what is going on. But it's not that hard. I don't think
>>> it's a good reason for avoiding them. On the other hand, I
>>> implemented a C++ variable length template expansion to produce a
>>> "simple JSON" which is in effect a varidaic function with type
>>> information. But whilst I implemented it myself, I can't remember
>>> exactly how it is supposed to work or what the syntax means.
>>>
>>
>> Variadic templates in C++ are typesafe, which is a big improvement
>> over C.
>>
>>
> A small improvement.
>
> If you have type safety, it can be easier to know how to call the
> function, because the system can help you by suggesting variables of the
> right type and rejecting variables of the wrong type. And because the
> type is often documentation about what the parameter means.
>

Type-safety means the compiler will reject arguments of the wrong type
for the function - or, alternatively, select (or generate) the correct
function for the type of the arguments. Either way, the function and
arguments match in type. Documentation has nothing to do with it.

> Then of course you can always create a bug by passing a varibale of the
> wrong type.

No, you can't - that's what type safety means. (Sure, you can - at
least in C and C++ - go out of your way with cast pointers, low-level
memory access, etc., to break type safety. No language can entirely
prevent the user writing intentionally dangerous code.)

>
> But it's not a big improvement because, if you call a function at all,
> you have to know what parameters it takes and what they mean anyway.

Yes, obviously. Type-safety means the language is safe in regard to
types. It doesn't stop other bugs.

> And
> whilst it does eliminate a bug, it's unlikely to be a dangerous bug, it
> will usually be manifested very early and likely caught.

Type-safety eliminates a huge class of bugs that could otherwise cause
all sorts of problems - some big, some small, some easily spotted and
some much more subtle. And it can be used as the basis for a lot more
safety features and checks if you want.

> So not the type
> of thing that is likely to much effect on delivery time or quality of
> the final product.

That is contrary to the experience of most high quality software
developers. There is a reason why few modern languages are weakly
typed. Strong typing does not stop all problems, nor is it necessary
for writing correct software, and using typing for safety can involve
writing more verbose code than otherwise necessary. But it is a major
tool towards writing good code, and having checks on the code quality.

> However of course that won't always be the case,
> especially if a long integer with all high bits zero happens to have the
> same observable effect as the correct short integer or similar.
>
> So there's a small advantage, but not a gamechanger.
>
> My simpleJSON is variadic C++. But of course if you pass
> "Nemployees",10.5, it will just create a JSON structure with a real
> field value 10.5.
>

Re: Variadic functions

<uolo3c$np9p$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32818&group=comp.lang.c#32818

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: malcolm.arthur.mclean@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Mon, 22 Jan 2024 12:46:36 +0000
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <uolo3c$np9p$1@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <uohef2$3r4em$6@dont-email.me>
<uohhvs$3rpaa$1@dont-email.me> <uohjet$3s00n$1@dont-email.me>
<uoi0ea$3tmbi$1@dont-email.me> <uojgfu$87o7$1@dont-email.me>
<uok3qh$coll$1@dont-email.me> <uol77s$l3er$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 22 Jan 2024 12:46:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e6bb492280758c2bd2c6011639f214f0";
logging-data="779577"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+kuGKb5y2wIZobaGurnXPaOPGzepgldkQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:iIuq9MXgw2sfMC6ppCmlow3QuRg=
In-Reply-To: <uol77s$l3er$1@dont-email.me>
Content-Language: en-GB
 by: Malcolm McLean - Mon, 22 Jan 2024 12:46 UTC

On 22/01/2024 07:58, David Brown wrote:
> On 21/01/2024 22:54, Malcolm McLean wrote:
>>
> That is contrary to the experience of most high quality software
> developers.  There is a reason why few modern languages are weakly
> typed.  Strong typing does not stop all problems, nor is it necessary
> for writing correct software, and using typing for safety can involve
> writing more verbose code than otherwise necessary.  But it is a major
> tool towards writing good code, and having checks on the code quality.
>
No, it's because there is a benefit, and it is easy to write a computer
program which checks for type. So there is a point in doing it. Then
there's often a perception that because something can be done by the
computer, it is important and beneficial, because the people who write
the development system must know what they are doing, and if the
computer says so, it must be correct.

Computer projects fail because the complexity of the interactions
between the sub systems exceeds the capacity of the developers to
understand them. Overwhelmingly. Not because developers sometimes pass
variables of the wrong type to functions.
--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Re: Variadic functions

<uolopc$nsnb$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32819&group=comp.lang.c#32819

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Mon, 22 Jan 2024 13:58:20 +0100
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <uolopc$nsnb$1@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <uohef2$3r4em$6@dont-email.me>
<uohhvs$3rpaa$1@dont-email.me> <uohjet$3s00n$1@dont-email.me>
<uoi0ea$3tmbi$1@dont-email.me> <uojgfu$87o7$1@dont-email.me>
<uok3qh$coll$1@dont-email.me> <uol77s$l3er$1@dont-email.me>
<uolo3c$np9p$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 22 Jan 2024 12:58:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="773b575d0a21626e330ecd5dcb685706";
logging-data="783083"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rulnmOYXzBsyu6aiDpvq+a11LjtF6qws="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:R4od9iaSS7L2nUs2IxjcPmDHo48=
In-Reply-To: <uolo3c$np9p$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Mon, 22 Jan 2024 12:58 UTC

On 22/01/2024 13:46, Malcolm McLean wrote:
> On 22/01/2024 07:58, David Brown wrote:
>> On 21/01/2024 22:54, Malcolm McLean wrote:
>>>
>> That is contrary to the experience of most high quality software
>> developers.  There is a reason why few modern languages are weakly
>> typed.  Strong typing does not stop all problems, nor is it necessary
>> for writing correct software, and using typing for safety can involve
>> writing more verbose code than otherwise necessary.  But it is a major
>> tool towards writing good code, and having checks on the code quality.
>>
> No, it's because there is a benefit, and it is easy to write a computer
> program which checks for type. So there is a point in doing it. Then
> there's often a perception that because something can be done by the
> computer, it is important and beneficial, because the people who write
> the development system must know what they are doing, and if the
> computer says so, it must be correct.
>
> Computer projects fail because the complexity of the interactions
> between the sub systems exceeds the capacity of the developers to
> understand them. Overwhelmingly. Not because developers sometimes pass
> variables of the wrong type to functions.

Software projects fail for countless different reasons. For many of the
possible reasons, computers can't help much. In cases where computers
(compilers, static analysis, run-time checkers, etc.) /can/ help, it
makes sense to use those features - it's more efficient, and usually
more accurate.

Strong typing is one of those cases - along with many other higher-level
language features.

(And no, it's not easy to make a language and tools that provide good
checking, a comfortable and productive language, and quality tools with
efficient compilation. It is, I believe, a good deal easier to make
languages and tools with very little type checking capabilities.)

Re: Variadic functions

<20240122114133.941@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32832&group=comp.lang.c#32832

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-6894@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Mon, 22 Jan 2024 19:44:20 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <20240122114133.941@kylheku.com>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <uohef2$3r4em$6@dont-email.me>
<uohhvs$3rpaa$1@dont-email.me> <uohjet$3s00n$1@dont-email.me>
<uoi0ea$3tmbi$1@dont-email.me> <uojgfu$87o7$1@dont-email.me>
<uok3qh$coll$1@dont-email.me> <uol77s$l3er$1@dont-email.me>
<uolo3c$np9p$1@dont-email.me>
Injection-Date: Mon, 22 Jan 2024 19:44:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="019b7810e586565adbc643fa2cd39f06";
logging-data="926954"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QaG0cr8PrTl8KEQIugBw+UZuTAVlIpEA="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:1kFxgzE6QLr+X83hL9RZ0084TZM=
 by: Kaz Kylheku - Mon, 22 Jan 2024 19:44 UTC

On 2024-01-22, Malcolm McLean <malcolm.arthur.mclean@gmail.com> wrote:
> Computer projects fail because the complexity of the interactions
> between the sub systems exceeds the capacity of the developers to
> understand them. Overwhelmingly. Not because developers sometimes pass
> variables of the wrong type to functions.

If passing wrong types to functions was not caught, either at compile
time, or at run time (as in dynamic languages) but simply resulted
in an object of one type being misused as another, then that would be
a huge source of bugs.

You can't tell whether wrong types are a source of bugs without working
in a typeless language.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: Variadic functions

<uomprq$tt48$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32843&group=comp.lang.c#32843

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: malcolm.arthur.mclean@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Mon, 22 Jan 2024 22:22:50 +0000
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <uomprq$tt48$1@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <uohef2$3r4em$6@dont-email.me>
<uohhvs$3rpaa$1@dont-email.me> <uohjet$3s00n$1@dont-email.me>
<uoi0ea$3tmbi$1@dont-email.me> <uojgfu$87o7$1@dont-email.me>
<uok3qh$coll$1@dont-email.me> <uol77s$l3er$1@dont-email.me>
<uolo3c$np9p$1@dont-email.me> <20240122114133.941@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 22 Jan 2024 22:22:50 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e6bb492280758c2bd2c6011639f214f0";
logging-data="980104"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18OUyF6PWhElB2AmSUNh66DY1bF/c3rzT4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:eDBI3/QROqxaTxCLoVK4MSvE8KA=
In-Reply-To: <20240122114133.941@kylheku.com>
Content-Language: en-GB
 by: Malcolm McLean - Mon, 22 Jan 2024 22:22 UTC

On 22/01/2024 19:44, Kaz Kylheku wrote:
> On 2024-01-22, Malcolm McLean <malcolm.arthur.mclean@gmail.com> wrote:
>> Computer projects fail because the complexity of the interactions
>> between the sub systems exceeds the capacity of the developers to
>> understand them. Overwhelmingly. Not because developers sometimes pass
>> variables of the wrong type to functions.
>
> If passing wrong types to functions was not caught, either at compile
> time, or at run time (as in dynamic languages) but simply resulted
> in an object of one type being misused as another, then that would be
> a huge source of bugs.
>
> You can't tell whether wrong types are a source of bugs without working
> in a typeless language.
>
You can use variadic functions in C.

When you use your "cat" function, for example, do you find it a problem
that is you pass a variable that isn't a character pointer, the system
will reinterpret the bits as though they were a character pointer?

And catching at run time is a bug, just an easy bug to detect and correct.
--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Re: Variadic functions

<uomq15$tt48$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32844&group=comp.lang.c#32844

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!nntp.comgw.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: malcolm.arthur.mclean@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Mon, 22 Jan 2024 22:25:41 +0000
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <uomq15$tt48$2@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <uohef2$3r4em$6@dont-email.me>
<uohhvs$3rpaa$1@dont-email.me> <uohjet$3s00n$1@dont-email.me>
<uoi0ea$3tmbi$1@dont-email.me> <uojgfu$87o7$1@dont-email.me>
<uok3qh$coll$1@dont-email.me> <uol77s$l3er$1@dont-email.me>
<uolo3c$np9p$1@dont-email.me> <uolopc$nsnb$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 22 Jan 2024 22:25:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e6bb492280758c2bd2c6011639f214f0";
logging-data="980104"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+3urUUPG09HdkAlrSsw95PP2gc0FWn4/4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:BO5Ldf8TEd+0dRWW2D6cWLxNTgE=
In-Reply-To: <uolopc$nsnb$1@dont-email.me>
Content-Language: en-GB
 by: Malcolm McLean - Mon, 22 Jan 2024 22:25 UTC

On 22/01/2024 12:58, David Brown wrote:
> On 22/01/2024 13:46, Malcolm McLean wrote:
>> On 22/01/2024 07:58, David Brown wrote:
>>> On 21/01/2024 22:54, Malcolm McLean wrote:
>>>>
>>> That is contrary to the experience of most high quality software
>>> developers.  There is a reason why few modern languages are weakly
>>> typed.  Strong typing does not stop all problems, nor is it necessary
>>> for writing correct software, and using typing for safety can involve
>>> writing more verbose code than otherwise necessary.  But it is a
>>> major tool towards writing good code, and having checks on the code
>>> quality.
>>>
>> No, it's because there is a benefit, and it is easy to write a
>> computer program which checks for type. So there is a point in doing
>> it. Then there's often a perception that because something can be done
>> by the computer, it is important and beneficial, because the people
>> who write the development system must know what they are doing, and if
>> the computer says so, it must be correct.
>>
>> Computer projects fail because the complexity of the interactions
>> between the sub systems exceeds the capacity of the developers to
>> understand them. Overwhelmingly. Not because developers sometimes pass
>> variables of the wrong type to functions.
>
> Software projects fail for countless different reasons.  For many of the
> possible reasons, computers can't help much.  In cases where computers
> (compilers, static analysis, run-time checkers, etc.) /can/ help, it
> makes sense to use those features - it's more efficient, and usually
> more accurate.
>
> Strong typing is one of those cases - along with many other higher-level
> language features.
>
> (And no, it's not easy to make a language and tools that provide good
> checking, a comfortable and productive language, and quality tools with
> efficient compilation.  It is, I believe, a good deal easier to make
> languages and tools with very little type checking capabilities.)
>
>
>
Have you tried to write a compiler or intepreter?

--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Re: Variadic functions

<pan$b84f3$321a3e4$17747387$71cad685@invalid.invalid>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32853&group=comp.lang.c#32853

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bluemanedhawk.eternal-september.org!.POSTED!not-for-mail
From: bluemanedhawk@invalid.invalid (Blue-Maned_Hawk)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Mon, 22 Jan 2024 23:25:22 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <pan$b84f3$321a3e4$17747387$71cad685@invalid.invalid>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <Kdccf9Gr26AQrYzxL@bongo-ra.co>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 22 Jan 2024 23:25:22 -0000 (UTC)
Injection-Info: bluemanedhawk.eternal-september.org; posting-host="e80390565b479469cf127d80eac58218";
logging-data="986781"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19661JDd1ej7+LZvoiTQZZymY//XlCsS5s="
User-Agent: Pan/0.154 (Izium; 517acf4)
Cancel-Lock: sha1:j1U01SrqqJp6vaFb81RtaClSAS4=
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACh0lEQVRYw71Z21bD
MAzzevbfkr4cHjrSXJyL044+MDa6WLEl2SkvkrZ1AbAvXO+bUGSCPYnsuIVGMpm
ZLnjX718GhAKNsp8lON2F9VrhELwIgJlBepkZjA78rVK+FkmNhEJK76UsJlz8+E
rJsjrpYouhLo/SC6qPHgakFOR8wV9+8rCfO/I/oVnmUZUp42/LW2XkLj9TCFNM9
jp5g2EmHZgpYZjCOkYU7sXVogRylJqpdggoFLG1g09Flah/7kErCxzR9HgXPYsq
0glb9cxjIz2Vsk9AmAoCSxECpD713joMKjQqLAtmMqJmXjdVvlMnMQCVITotJd1
z+fh1f1NNo+vuc1KnhWUmY7t03vydTud9BbXCtN3L2PL3bK7JCNG0GHzuZxafyB
fxevCxpm1vrwZltqw6SILCcdoCE6PGQC8wZWDA9Or7Qp5s3lAZezys0nDazs9S9
R0TjwEiksRxLkNPC1NMMWPs1bj0Ei0Yuo+JVtFLuzP1NRJ16qXWN8DhhtmS4PDg
O6mqRxs4bEJrYt087mSIow/1VzW2oFlMQuiuIy/KsUagvhdw6hSjJGlIavbLF8x
j3X47bccLcUSi0dkWh1nUZNhANT1tHKUXrNxNLbd9KPb9wDDVrKwmPQMOPQ1oy6
k5I1DwzDeRJd3jVIhDAUxq3ngzJG4CCkNXZxZVMcjefoK2J0gUY2S3rxz/RuTFx
2zHd9U+obimJXMG4edsk/2j5pTU5G1MmzbRLxkfq5EiT1GGsidvMGzi+1goGb2l
GCrN+nGnV8xj3q3JLRDVPL96vUc7Z4aJ3TN1mVqWAMJMfG+Jxh6TQqP+92iZkCU
xtglds1AB6r0aiSHKcnFck+p/c/0CbacFLQcajGcAAAAASUVORK5CYII=
X-Face: Llanfair­pwllgwyngyllÃ
ƒ‚Ã
ƒƒ‚­gogery­chwyrnÃ
ƒƒ
? ?‚­drobwll­llan
Ã
? ?ƒƒ‚­tysilio­go
g
o­goch
 by: Blue-Maned_Hawk - Mon, 22 Jan 2024 23:25 UTC

Spiros Bousbouras wrote:

> On Sat, 20 Jan 2024 11:19:57 +0000 Malcolm McLean
> <malcolm.arthur.mclean@gmail.com> wrote:
>> But no-one has yet come up with an occasion where they implemented a
>> variadic function by choice, for code which they controlled, except for
>> printf style formatting. Either a hobby project or work code for which
>> they had ownership.
>
> I asked a similar question on this group many years ago. One example
> given was a function for concatenating strings which would accept as
> arguments a variable number of strings.

I've only ever done chained strcat calls, e.g.
strcat(strcat(strcat(something, "blah"), "whatever"), "nonsense").

--
Blue-Maned_Hawk│shortens to
Hawk│/
blu.mɛin.dÊ°ak/
│he/him/his/himself/Mr.
blue-maned_hawk.srht.site
“Hotel California” is completely literal and the Eagles are still trapped
there.

Re: Variadic functions

<pan$bfc88$7de72476$fcc3b371$5ad7c9a9@invalid.invalid>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32854&group=comp.lang.c#32854

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bluemanedhawk.eternal-september.org!.POSTED!not-for-mail
From: bluemanedhawk@invalid.invalid (Blue-Maned_Hawk)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Mon, 22 Jan 2024 23:27:31 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <pan$bfc88$7de72476$fcc3b371$5ad7c9a9@invalid.invalid>
References: <uoed9m$387sh$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 22 Jan 2024 23:27:31 -0000 (UTC)
Injection-Info: bluemanedhawk.eternal-september.org; posting-host="e80390565b479469cf127d80eac58218";
logging-data="986781"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FeNX3yWuMI5AR35Pd6JarD7t2krIL05c="
User-Agent: Pan/0.154 (Izium; 517acf4)
Cancel-Lock: sha1:NjLqSV4qHA0Xzxy+Z6Ip1ABIo2A=
X-Face: Llanfair­pwllgwyngyllÃ
ƒ‚Ã
ƒƒ‚­gogery­chwyrnÃ
ƒƒ
? ?‚­drobwll­llan
Ã
? ?ƒƒ‚­tysilio­go
g
o­goch
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACh0lEQVRYw71Z21bD
MAzzevbfkr4cHjrSXJyL044+MDa6WLEl2SkvkrZ1AbAvXO+bUGSCPYnsuIVGMpm
ZLnjX718GhAKNsp8lON2F9VrhELwIgJlBepkZjA78rVK+FkmNhEJK76UsJlz8+E
rJsjrpYouhLo/SC6qPHgakFOR8wV9+8rCfO/I/oVnmUZUp42/LW2XkLj9TCFNM9
jp5g2EmHZgpYZjCOkYU7sXVogRylJqpdggoFLG1g09Flah/7kErCxzR9HgXPYsq
0glb9cxjIz2Vsk9AmAoCSxECpD713joMKjQqLAtmMqJmXjdVvlMnMQCVITotJd1
z+fh1f1NNo+vuc1KnhWUmY7t03vydTud9BbXCtN3L2PL3bK7JCNG0GHzuZxafyB
fxevCxpm1vrwZltqw6SILCcdoCE6PGQC8wZWDA9Or7Qp5s3lAZezys0nDazs9S9
R0TjwEiksRxLkNPC1NMMWPs1bj0Ei0Yuo+JVtFLuzP1NRJ16qXWN8DhhtmS4PDg
O6mqRxs4bEJrYt087mSIow/1VzW2oFlMQuiuIy/KsUagvhdw6hSjJGlIavbLF8x
j3X47bccLcUSi0dkWh1nUZNhANT1tHKUXrNxNLbd9KPb9wDDVrKwmPQMOPQ1oy6
k5I1DwzDeRJd3jVIhDAUxq3ngzJG4CCkNXZxZVMcjefoK2J0gUY2S3rxz/RuTFx
2zHd9U+obimJXMG4edsk/2j5pTU5G1MmzbRLxkfq5EiT1GGsidvMGzi+1goGb2l
GCrN+nGnV8xj3q3JLRDVPL96vUc7Z4aJ3TN1mVqWAMJMfG+Jxh6TQqP+92iZkCU
xtglds1AB6r0aiSHKcnFck+p/c/0CbacFLQcajGcAAAAASUVORK5CYII=
 by: Blue-Maned_Hawk - Mon, 22 Jan 2024 23:27 UTC

Malcolm McLean wrote:

> Who has actually used a variadic function for any purpose other than
> implementing printf-style format strings?

I'll admit to not having written many of them. But i _have_ written a lot
of variadic macros, though this has mostly been so as to prevent problems
with commas in arguments.

--
Blue-Maned_Hawk│shortens to
Hawk│/
blu.mɛin.dÊ°ak/
│he/him/his/himself/Mr.
blue-maned_hawk.srht.site

Re: Variadic functions

<uomu5q$uj61$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32855&group=comp.lang.c#32855

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Mon, 22 Jan 2024 23:36:26 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 6
Message-ID: <uomu5q$uj61$2@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <Kdccf9Gr26AQrYzxL@bongo-ra.co>
<pan$b84f3$321a3e4$17747387$71cad685@invalid.invalid>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 22 Jan 2024 23:36:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b483129fb1b43c5ca91b5930e33c4fdf";
logging-data="1002689"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19MbbOPyqbvahh/KRHUFzc/"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:6zIFQliQ2PnoC0P9H1XteAI3+iM=
 by: Lawrence D'Oliv - Mon, 22 Jan 2024 23:36 UTC

On Mon, 22 Jan 2024 23:25:22 -0000 (UTC), Blue-Maned_Hawk wrote:

> I've only ever done chained strcat calls, e.g.
> strcat(strcat(strcat(something, "blah"), "whatever"), "nonsense").

You’ve got to be kidding.

Re: Variadic functions

<20240122160107.493@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32858&group=comp.lang.c#32858

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-6894@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Tue, 23 Jan 2024 00:01:39 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <20240122160107.493@kylheku.com>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <uohef2$3r4em$6@dont-email.me>
<uohhvs$3rpaa$1@dont-email.me> <uohjet$3s00n$1@dont-email.me>
<uoi0ea$3tmbi$1@dont-email.me> <uojgfu$87o7$1@dont-email.me>
<uok3qh$coll$1@dont-email.me> <uol77s$l3er$1@dont-email.me>
<uolo3c$np9p$1@dont-email.me> <20240122114133.941@kylheku.com>
<uomprq$tt48$1@dont-email.me>
Injection-Date: Tue, 23 Jan 2024 00:01:39 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="89a24c451ef1c6e54f4783ce54b57f43";
logging-data="1009138"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18pjk/P/95MmWVBgRJvVjHI0384+ki8p3Y="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:+4NsSDnHYpy0XfUBzJWEZ/9EhaQ=
 by: Kaz Kylheku - Tue, 23 Jan 2024 00:01 UTC

On 2024-01-22, Malcolm McLean <malcolm.arthur.mclean@gmail.com> wrote:
> On 22/01/2024 19:44, Kaz Kylheku wrote:
>> On 2024-01-22, Malcolm McLean <malcolm.arthur.mclean@gmail.com> wrote:
>>> Computer projects fail because the complexity of the interactions
>>> between the sub systems exceeds the capacity of the developers to
>>> understand them. Overwhelmingly. Not because developers sometimes pass
>>> variables of the wrong type to functions.
>>
>> If passing wrong types to functions was not caught, either at compile
>> time, or at run time (as in dynamic languages) but simply resulted
>> in an object of one type being misused as another, then that would be
>> a huge source of bugs.
>>
>> You can't tell whether wrong types are a source of bugs without working
>> in a typeless language.
>>
> You can use variadic functions in C.
>
> When you use your "cat" function, for example, do you find it a problem
> that is you pass a variable that isn't a character pointer, the system
> will reinterpret the bits as though they were a character pointer?

Yes?

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: Variadic functions

<uons3c$16lgq$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32870&group=comp.lang.c#32870

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Tue, 23 Jan 2024 09:07:07 +0100
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <uons3c$16lgq$1@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <uohef2$3r4em$6@dont-email.me>
<uohhvs$3rpaa$1@dont-email.me> <uohjet$3s00n$1@dont-email.me>
<uoi0ea$3tmbi$1@dont-email.me> <uojgfu$87o7$1@dont-email.me>
<uok3qh$coll$1@dont-email.me> <uol77s$l3er$1@dont-email.me>
<uolo3c$np9p$1@dont-email.me> <uolopc$nsnb$1@dont-email.me>
<uomq15$tt48$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 23 Jan 2024 08:07:08 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c843dfd51cca0053a7acde203d8da68e";
logging-data="1267226"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Oi1cWXgqggy3Tn09r9ckph4l1e0y2prA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:JI5MU0j7TXPYHy82GXb1LZQBrno=
In-Reply-To: <uomq15$tt48$2@dont-email.me>
Content-Language: en-GB
 by: David Brown - Tue, 23 Jan 2024 08:07 UTC

On 22/01/2024 23:25, Malcolm McLean wrote:
> On 22/01/2024 12:58, David Brown wrote:
>> On 22/01/2024 13:46, Malcolm McLean wrote:
>>> On 22/01/2024 07:58, David Brown wrote:
>>>> On 21/01/2024 22:54, Malcolm McLean wrote:
>>>>>
>>>> That is contrary to the experience of most high quality software
>>>> developers.  There is a reason why few modern languages are weakly
>>>> typed.  Strong typing does not stop all problems, nor is it
>>>> necessary for writing correct software, and using typing for safety
>>>> can involve writing more verbose code than otherwise necessary.  But
>>>> it is a major tool towards writing good code, and having checks on
>>>> the code quality.
>>>>
>>> No, it's because there is a benefit, and it is easy to write a
>>> computer program which checks for type. So there is a point in doing
>>> it. Then there's often a perception that because something can be
>>> done by the computer, it is important and beneficial, because the
>>> people who write the development system must know what they are
>>> doing, and if the computer says so, it must be correct.
>>>
>>> Computer projects fail because the complexity of the interactions
>>> between the sub systems exceeds the capacity of the developers to
>>> understand them. Overwhelmingly. Not because developers sometimes
>>> pass variables of the wrong type to functions.
>>
>> Software projects fail for countless different reasons.  For many of
>> the possible reasons, computers can't help much.  In cases where
>> computers (compilers, static analysis, run-time checkers, etc.) /can/
>> help, it makes sense to use those features - it's more efficient, and
>> usually more accurate.
>>
>> Strong typing is one of those cases - along with many other
>> higher-level language features.
>>
>> (And no, it's not easy to make a language and tools that provide good
>> checking, a comfortable and productive language, and quality tools
>> with efficient compilation.  It is, I believe, a good deal easier to
>> make languages and tools with very little type checking capabilities.)
>>
>>
>>
> Have you tried to write a compiler or intepreter?
>

No (except for tiny DSL's).

But I also have not tried to fly a plane, yet I know that some types of
plane are easier to fly than others.

Re: Variadic functions

<uont8s$16sb4$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32872&group=comp.lang.c#32872

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!newsfeed.endofthelinebbs.com!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: malcolm.arthur.mclean@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Tue, 23 Jan 2024 08:27:08 +0000
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <uont8s$16sb4$1@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <uohef2$3r4em$6@dont-email.me>
<uohhvs$3rpaa$1@dont-email.me> <uohjet$3s00n$1@dont-email.me>
<uoi0ea$3tmbi$1@dont-email.me> <uojgfu$87o7$1@dont-email.me>
<uok3qh$coll$1@dont-email.me> <uol77s$l3er$1@dont-email.me>
<uolo3c$np9p$1@dont-email.me> <uolopc$nsnb$1@dont-email.me>
<uomq15$tt48$2@dont-email.me> <uons3c$16lgq$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 23 Jan 2024 08:27:08 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3f2fda70686ab981ae50523ea4f7581b";
logging-data="1274212"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+mINZUW6WLrarAeBqIqqf9YsybmVcL2p0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:jxevbZAZqTjOn7EEZ+R6gJ6v3TM=
In-Reply-To: <uons3c$16lgq$1@dont-email.me>
Content-Language: en-GB
 by: Malcolm McLean - Tue, 23 Jan 2024 08:27 UTC

On 23/01/2024 08:07, David Brown wrote:
> On 22/01/2024 23:25, Malcolm McLean wrote:
>> On 22/01/2024 12:58, David Brown wrote:
>>> On 22/01/2024 13:46, Malcolm McLean wrote:
>>>> On 22/01/2024 07:58, David Brown wrote:
>>>>> On 21/01/2024 22:54, Malcolm McLean wrote:
>>>>>>
>>>>> That is contrary to the experience of most high quality software
>>>>> developers.  There is a reason why few modern languages are weakly
>>>>> typed.  Strong typing does not stop all problems, nor is it
>>>>> necessary for writing correct software, and using typing for safety
>>>>> can involve writing more verbose code than otherwise necessary.
>>>>> But it is a major tool towards writing good code, and having checks
>>>>> on the code quality.
>>>>>
>>>> No, it's because there is a benefit, and it is easy to write a
>>>> computer program which checks for type. So there is a point in doing
>>>> it. Then there's often a perception that because something can be
>>>> done by the computer, it is important and beneficial, because the
>>>> people who write the development system must know what they are
>>>> doing, and if the computer says so, it must be correct.
>>>>
>>>> Computer projects fail because the complexity of the interactions
>>>> between the sub systems exceeds the capacity of the developers to
>>>> understand them. Overwhelmingly. Not because developers sometimes
>>>> pass variables of the wrong type to functions.
>>>
>>> Software projects fail for countless different reasons.  For many of
>>> the possible reasons, computers can't help much.  In cases where
>>> computers (compilers, static analysis, run-time checkers, etc.) /can/
>>> help, it makes sense to use those features - it's more efficient, and
>>> usually more accurate.
>>>
>>> Strong typing is one of those cases - along with many other
>>> higher-level language features.
>>>
>>> (And no, it's not easy to make a language and tools that provide good
>>> checking, a comfortable and productive language, and quality tools
>>> with efficient compilation.  It is, I believe, a good deal easier to
>>> make languages and tools with very little type checking capabilities.)
>>>
>>>
>>>
>> Have you tried to write a compiler or intepreter?
>>
>
> No (except for tiny DSL's).
>
> But I also have not tried to fly a plane, yet I know that some types of
> plane are easier to fly than others.
>
>
Bascially it's just a grammar rule, and you'll already have a flexible
grammar system because you need it for the rest of the compiler.
Technically it will be a "constraint" on the grammar as most grammars
can't express "function_call = function_name open_parentheses
variable_of_a_type_that_matches close_parentheses".

--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Re: Variadic functions

<uonteh$16sb4$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32874&group=comp.lang.c#32874

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!nntp.comgw.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: malcolm.arthur.mclean@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Tue, 23 Jan 2024 08:30:09 +0000
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <uonteh$16sb4$2@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <Kdccf9Gr26AQrYzxL@bongo-ra.co>
<pan$b84f3$321a3e4$17747387$71cad685@invalid.invalid>
<uomu5q$uj61$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 23 Jan 2024 08:30:09 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3f2fda70686ab981ae50523ea4f7581b";
logging-data="1274212"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++6ztojDHmcnuwabL3jrsv/ZD4TIBi5qI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:6zHuOyFCANI46sbrAfKLtD7Iw/Y=
In-Reply-To: <uomu5q$uj61$2@dont-email.me>
Content-Language: en-GB
 by: Malcolm McLean - Tue, 23 Jan 2024 08:30 UTC

On 22/01/2024 23:36, Lawrence D'Oliveiro wrote:
> On Mon, 22 Jan 2024 23:25:22 -0000 (UTC), Blue-Maned_Hawk wrote:
>
>> I've only ever done chained strcat calls, e.g.
>> strcat(strcat(strcat(something, "blah"), "whatever"), "nonsense").
>
> You’ve got to be kidding.
>
That was why strcat retutns a pointer. It was how it was meant to be
used. But it never caught on.

--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Re: Variadic functions

<uoo238$17kfl$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32876&group=comp.lang.c#32876

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Tue, 23 Jan 2024 10:49:27 +0100
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <uoo238$17kfl$1@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <Kdccf9Gr26AQrYzxL@bongo-ra.co>
<pan$b84f3$321a3e4$17747387$71cad685@invalid.invalid>
<uomu5q$uj61$2@dont-email.me> <uonteh$16sb4$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 23 Jan 2024 09:49:28 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c843dfd51cca0053a7acde203d8da68e";
logging-data="1298933"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19raoSsfjxiG8Bfq84deNDKem5dHG/zjQk="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:9MV9U4Db7Vg1cXSgq+Mdv2AEQK4=
In-Reply-To: <uonteh$16sb4$2@dont-email.me>
Content-Language: en-GB
 by: David Brown - Tue, 23 Jan 2024 09:49 UTC

On 23/01/2024 09:30, Malcolm McLean wrote:
> On 22/01/2024 23:36, Lawrence D'Oliveiro wrote:
>> On Mon, 22 Jan 2024 23:25:22 -0000 (UTC), Blue-Maned_Hawk wrote:
>>
>>> I've only ever done chained strcat calls, e.g.
>>> strcat(strcat(strcat(something, "blah"), "whatever"), "nonsense").
>>
>> You’ve got to be kidding.
> >
> That was why strcat retutns a pointer. It was how it was meant to be
> used. But it never caught on.
>

I don't think that is a reasonable way to put it. Rather, say that
strcat and strcpy return their first argument because that was what the
library specifiers felt would be the most useful return value. One of
the possibilities it allows is chaining like this.

One possible reason why people don't use it - perhaps preferring to use
snprintf or non-standard functions for multiple concatenation - is that
a naïve implementation is unnecessarily inefficient. For such uses, it
would be far better if strcat and strcpy had returned a pointer to one
past the end of the resulting string, rather than duplicating the
initial pointer. (For other uses, maybe it is more convenient to have
the returns the way strcat and strcpy do.)

Some optimising compilers will do a better job, and will optimise such
nested strcat() calls for efficiency, making it a perfectly reasonable
construction if you are using something like gcc (or if efficiency is
not an issue).

Re: Variadic functions

<uoo28o$17khr$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32877&group=comp.lang.c#32877

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Tue, 23 Jan 2024 10:52:24 +0100
Organization: A noiseless patient Spider
Lines: 67
Message-ID: <uoo28o$17khr$1@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <uohef2$3r4em$6@dont-email.me>
<uohhvs$3rpaa$1@dont-email.me> <uohjet$3s00n$1@dont-email.me>
<uoi0ea$3tmbi$1@dont-email.me> <uojgfu$87o7$1@dont-email.me>
<uok3qh$coll$1@dont-email.me> <uol77s$l3er$1@dont-email.me>
<uolo3c$np9p$1@dont-email.me> <uolopc$nsnb$1@dont-email.me>
<uomq15$tt48$2@dont-email.me> <uons3c$16lgq$1@dont-email.me>
<uont8s$16sb4$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 23 Jan 2024 09:52:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c843dfd51cca0053a7acde203d8da68e";
logging-data="1299003"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/tLGDM5NffQfWyfueLQNXgrSm8KiG8gns="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:r+Fbyb/osXvpqNwpRicc9GMg4go=
In-Reply-To: <uont8s$16sb4$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Tue, 23 Jan 2024 09:52 UTC

On 23/01/2024 09:27, Malcolm McLean wrote:
> On 23/01/2024 08:07, David Brown wrote:
>> On 22/01/2024 23:25, Malcolm McLean wrote:
>>> On 22/01/2024 12:58, David Brown wrote:
>>>> On 22/01/2024 13:46, Malcolm McLean wrote:
>>>>> On 22/01/2024 07:58, David Brown wrote:
>>>>>> On 21/01/2024 22:54, Malcolm McLean wrote:
>>>>>>>
>>>>>> That is contrary to the experience of most high quality software
>>>>>> developers.  There is a reason why few modern languages are weakly
>>>>>> typed.  Strong typing does not stop all problems, nor is it
>>>>>> necessary for writing correct software, and using typing for
>>>>>> safety can involve writing more verbose code than otherwise
>>>>>> necessary. But it is a major tool towards writing good code, and
>>>>>> having checks on the code quality.
>>>>>>
>>>>> No, it's because there is a benefit, and it is easy to write a
>>>>> computer program which checks for type. So there is a point in
>>>>> doing it. Then there's often a perception that because something
>>>>> can be done by the computer, it is important and beneficial,
>>>>> because the people who write the development system must know what
>>>>> they are doing, and if the computer says so, it must be correct.
>>>>>
>>>>> Computer projects fail because the complexity of the interactions
>>>>> between the sub systems exceeds the capacity of the developers to
>>>>> understand them. Overwhelmingly. Not because developers sometimes
>>>>> pass variables of the wrong type to functions.
>>>>
>>>> Software projects fail for countless different reasons.  For many of
>>>> the possible reasons, computers can't help much.  In cases where
>>>> computers (compilers, static analysis, run-time checkers, etc.)
>>>> /can/ help, it makes sense to use those features - it's more
>>>> efficient, and usually more accurate.
>>>>
>>>> Strong typing is one of those cases - along with many other
>>>> higher-level language features.
>>>>
>>>> (And no, it's not easy to make a language and tools that provide
>>>> good checking, a comfortable and productive language, and quality
>>>> tools with efficient compilation.  It is, I believe, a good deal
>>>> easier to make languages and tools with very little type checking
>>>> capabilities.)
>>>>
>>>>
>>>>
>>> Have you tried to write a compiler or intepreter?
>>>
>>
>> No (except for tiny DSL's).
>>
>> But I also have not tried to fly a plane, yet I know that some types
>> of plane are easier to fly than others.
>>
>>
> Bascially it's just a grammar rule, and you'll already have a flexible
> grammar system because you need it for the rest of the compiler.
> Technically it will be a "constraint" on the grammar as most grammars
> can't express "function_call = function_name open_parentheses
> variable_of_a_type_that_matches close_parentheses".
>

That is not the difference between strong typing and weak typing, nor is
it all you need for a language to support good typing. But perhaps we
have lost track of exactly what we are talking about here, and are
thinking about different things, or at least different aspects of
typing. Let's leave it for now.

Re: Variadic functions

<xVQrN.249990$Wp_8.4423@fx17.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32879&group=comp.lang.c#32879

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx17.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Variadic functions
Newsgroups: comp.lang.c
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me> <uoga8t$3l6mu$1@dont-email.me> <Kdccf9Gr26AQrYzxL@bongo-ra.co> <pan$b84f3$321a3e4$17747387$71cad685@invalid.invalid> <uomu5q$uj61$2@dont-email.me> <uonteh$16sb4$2@dont-email.me>
Lines: 15
Message-ID: <xVQrN.249990$Wp_8.4423@fx17.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 23 Jan 2024 15:27:25 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 23 Jan 2024 15:27:25 GMT
X-Received-Bytes: 1307
 by: Scott Lurndal - Tue, 23 Jan 2024 15:27 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>On 22/01/2024 23:36, Lawrence D'Oliveiro wrote:
>> On Mon, 22 Jan 2024 23:25:22 -0000 (UTC), Blue-Maned_Hawk wrote:
>>
>>> I've only ever done chained strcat calls, e.g.
>>> strcat(strcat(strcat(something, "blah"), "whatever"), "nonsense").
>>
>> You’ve got to be kidding.
> >
>That was why strcat retutns a pointer. It was how it was meant to be
>used. But it never caught on.
>
For rather good reason. Too easy to overrun the size of the buffer.

Huge security hole.

Re: Variadic functions

<uopc7g$1f17i$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32896&group=comp.lang.c#32896

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.furie.org.uk!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Tue, 23 Jan 2024 21:48:32 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 6
Message-ID: <uopc7g$1f17i$2@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <Kdccf9Gr26AQrYzxL@bongo-ra.co>
<pan$b84f3$321a3e4$17747387$71cad685@invalid.invalid>
<uomu5q$uj61$2@dont-email.me> <uonteh$16sb4$2@dont-email.me>
<xVQrN.249990$Wp_8.4423@fx17.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 23 Jan 2024 21:48:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b483129fb1b43c5ca91b5930e33c4fdf";
logging-data="1541362"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19cOh+p1sIbwi6XStcsJxe9"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:F37e+tpOekLq8lMOS6qFx1INCks=
 by: Lawrence D'Oliv - Tue, 23 Jan 2024 21:48 UTC

On Tue, 23 Jan 2024 15:27:25 GMT, Scott Lurndal wrote:

> Huge security hole.

That was the point I was trying to make, but it seemed to go over
somebody’s head ...

Re: Variadic functions

<pan$831a1$96fbd1f4$299773f2$f38c318a@invalid.invalid>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32909&group=comp.lang.c#32909

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bluemanedhawk.eternal-september.org!.POSTED!not-for-mail
From: bluemanedhawk@invalid.invalid (Blue-Maned_Hawk)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Tue, 23 Jan 2024 22:17:12 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <pan$831a1$96fbd1f4$299773f2$f38c318a@invalid.invalid>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <uohef2$3r4em$6@dont-email.me>
<uohhvs$3rpaa$1@dont-email.me> <uohjet$3s00n$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 23 Jan 2024 22:17:12 -0000 (UTC)
Injection-Info: bluemanedhawk.eternal-september.org; posting-host="e80390565b479469cf127d80eac58218";
logging-data="1549429"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7H8uRofcV8KSP38nzQIXvs/4ESkl6d0s="
User-Agent: Pan/0.154 (Izium; 517acf4)
Cancel-Lock: sha1:7c9ODMB0D10kzfREL9vbW9gTT4o=
X-Face: Llanfair­pwllgwyngyllÃ
ƒ‚Ã
ƒƒ‚­gogery­chwyrnÃ
ƒƒ
? ?‚­drobwll­llan
Ã
? ?ƒƒ‚­tysilio­go
g
o­goch
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACh0lEQVRYw71Z21bD
MAzzevbfkr4cHjrSXJyL044+MDa6WLEl2SkvkrZ1AbAvXO+bUGSCPYnsuIVGMpm
ZLnjX718GhAKNsp8lON2F9VrhELwIgJlBepkZjA78rVK+FkmNhEJK76UsJlz8+E
rJsjrpYouhLo/SC6qPHgakFOR8wV9+8rCfO/I/oVnmUZUp42/LW2XkLj9TCFNM9
jp5g2EmHZgpYZjCOkYU7sXVogRylJqpdggoFLG1g09Flah/7kErCxzR9HgXPYsq
0glb9cxjIz2Vsk9AmAoCSxECpD713joMKjQqLAtmMqJmXjdVvlMnMQCVITotJd1
z+fh1f1NNo+vuc1KnhWUmY7t03vydTud9BbXCtN3L2PL3bK7JCNG0GHzuZxafyB
fxevCxpm1vrwZltqw6SILCcdoCE6PGQC8wZWDA9Or7Qp5s3lAZezys0nDazs9S9
R0TjwEiksRxLkNPC1NMMWPs1bj0Ei0Yuo+JVtFLuzP1NRJ16qXWN8DhhtmS4PDg
O6mqRxs4bEJrYt087mSIow/1VzW2oFlMQuiuIy/KsUagvhdw6hSjJGlIavbLF8x
j3X47bccLcUSi0dkWh1nUZNhANT1tHKUXrNxNLbd9KPb9wDDVrKwmPQMOPQ1oy6
k5I1DwzDeRJd3jVIhDAUxq3ngzJG4CCkNXZxZVMcjefoK2J0gUY2S3rxz/RuTFx
2zHd9U+obimJXMG4edsk/2j5pTU5G1MmzbRLxkfq5EiT1GGsidvMGzi+1goGb2l
GCrN+nGnV8xj3q3JLRDVPL96vUc7Z4aJ3TN1mVqWAMJMfG+Jxh6TQqP+92iZkCU
xtglds1AB6r0aiSHKcnFck+p/c/0CbacFLQcajGcAAAAASUVORK5CYII=
 by: Blue-Maned_Hawk - Tue, 23 Jan 2024 22:17 UTC

bart wrote:

> But it is not a desirable feature for general use as it is not
> type-safe.

Data types are a social construct.

--
Blue-Maned_Hawk│shortens to
Hawk│/
blu.mɛin.dÊ°ak/
│he/him/his/himself/Mr.
blue-maned_hawk.srht.site
Very fred kindley!

Re: Variadic functions

<pan$1a307$af4c3919$3ac5764a$a842aaa1@invalid.invalid>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32910&group=comp.lang.c#32910

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bluemanedhawk.eternal-september.org!.POSTED!not-for-mail
From: bluemanedhawk@invalid.invalid (Blue-Maned_Hawk)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Tue, 23 Jan 2024 22:25:46 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <pan$1a307$af4c3919$3ac5764a$a842aaa1@invalid.invalid>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <Kdccf9Gr26AQrYzxL@bongo-ra.co>
<pan$b84f3$321a3e4$17747387$71cad685@invalid.invalid>
<uomu5q$uj61$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 23 Jan 2024 22:25:46 -0000 (UTC)
Injection-Info: bluemanedhawk.eternal-september.org; posting-host="e80390565b479469cf127d80eac58218";
logging-data="1549429"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/wA+MeW/f8ccswU8utylDCm6FXDSkD7jM="
User-Agent: Pan/0.154 (Izium; 517acf4)
Cancel-Lock: sha1:TXQ3k+UeGpUEvegEw72YKg++/hU=
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACh0lEQVRYw71Z21bD
MAzzevbfkr4cHjrSXJyL044+MDa6WLEl2SkvkrZ1AbAvXO+bUGSCPYnsuIVGMpm
ZLnjX718GhAKNsp8lON2F9VrhELwIgJlBepkZjA78rVK+FkmNhEJK76UsJlz8+E
rJsjrpYouhLo/SC6qPHgakFOR8wV9+8rCfO/I/oVnmUZUp42/LW2XkLj9TCFNM9
jp5g2EmHZgpYZjCOkYU7sXVogRylJqpdggoFLG1g09Flah/7kErCxzR9HgXPYsq
0glb9cxjIz2Vsk9AmAoCSxECpD713joMKjQqLAtmMqJmXjdVvlMnMQCVITotJd1
z+fh1f1NNo+vuc1KnhWUmY7t03vydTud9BbXCtN3L2PL3bK7JCNG0GHzuZxafyB
fxevCxpm1vrwZltqw6SILCcdoCE6PGQC8wZWDA9Or7Qp5s3lAZezys0nDazs9S9
R0TjwEiksRxLkNPC1NMMWPs1bj0Ei0Yuo+JVtFLuzP1NRJ16qXWN8DhhtmS4PDg
O6mqRxs4bEJrYt087mSIow/1VzW2oFlMQuiuIy/KsUagvhdw6hSjJGlIavbLF8x
j3X47bccLcUSi0dkWh1nUZNhANT1tHKUXrNxNLbd9KPb9wDDVrKwmPQMOPQ1oy6
k5I1DwzDeRJd3jVIhDAUxq3ngzJG4CCkNXZxZVMcjefoK2J0gUY2S3rxz/RuTFx
2zHd9U+obimJXMG4edsk/2j5pTU5G1MmzbRLxkfq5EiT1GGsidvMGzi+1goGb2l
GCrN+nGnV8xj3q3JLRDVPL96vUc7Z4aJ3TN1mVqWAMJMfG+Jxh6TQqP+92iZkCU
xtglds1AB6r0aiSHKcnFck+p/c/0CbacFLQcajGcAAAAASUVORK5CYII=
X-Face: Llanfair­pwllgwyngyllÃ
ƒ‚Ã
ƒƒ‚­gogery­chwyrnÃ
ƒƒ
? ?‚­drobwll­llan
Ã
? ?ƒƒ‚­tysilio­go
g
o­goch
 by: Blue-Maned_Hawk - Tue, 23 Jan 2024 22:25 UTC

Lawrence D'Oliveiro wrote:

> On Mon, 22 Jan 2024 23:25:22 -0000 (UTC), Blue-Maned_Hawk wrote:
>
>> I've only ever done chained strcat calls, e.g.
>> strcat(strcat(strcat(something, "blah"), "whatever"), "nonsense").
>
> You’ve got to be kidding.

I am not kidding. Here's an actual fragment of code where i used it to
format an array of backtrace symbols to be on one line each:

for (int i = 0; i < depth; ++i)
strcat(strcat(strcat(btstr, "\t"), btsyms[i]), "\n");

--
Blue-Maned_Hawk│shortens to
Hawk│/
blu.mɛin.dÊ°ak/
│he/him/his/himself/Mr.
blue-maned_hawk.srht.site
Sip it, don't chug it!

Re: Variadic functions

<pan$514f$ac2be24d$a46eca3d$5aa9624@invalid.invalid>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32911&group=comp.lang.c#32911

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bluemanedhawk.eternal-september.org!.POSTED!not-for-mail
From: bluemanedhawk@invalid.invalid (Blue-Maned_Hawk)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Tue, 23 Jan 2024 22:28:03 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <pan$514f$ac2be24d$a46eca3d$5aa9624@invalid.invalid>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <Kdccf9Gr26AQrYzxL@bongo-ra.co>
<pan$b84f3$321a3e4$17747387$71cad685@invalid.invalid>
<uomu5q$uj61$2@dont-email.me> <uonteh$16sb4$2@dont-email.me>
<xVQrN.249990$Wp_8.4423@fx17.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 23 Jan 2024 22:28:03 -0000 (UTC)
Injection-Info: bluemanedhawk.eternal-september.org; posting-host="e80390565b479469cf127d80eac58218";
logging-data="1549429"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18KxQ8S2NQvKx2TQ7+k4DbTJIUFA9bxlhg="
User-Agent: Pan/0.154 (Izium; 517acf4)
Cancel-Lock: sha1:Px0s6zPTgKfWQ8NBI0lOxAU09os=
X-Face: Llanfair­pwllgwyngyllÃ
ƒ‚Ã
ƒƒ‚­gogery­chwyrnÃ
ƒƒ
? ?‚­drobwll­llan
Ã
? ?ƒƒ‚­tysilio­go
g
o­goch
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACh0lEQVRYw71Z21bD
MAzzevbfkr4cHjrSXJyL044+MDa6WLEl2SkvkrZ1AbAvXO+bUGSCPYnsuIVGMpm
ZLnjX718GhAKNsp8lON2F9VrhELwIgJlBepkZjA78rVK+FkmNhEJK76UsJlz8+E
rJsjrpYouhLo/SC6qPHgakFOR8wV9+8rCfO/I/oVnmUZUp42/LW2XkLj9TCFNM9
jp5g2EmHZgpYZjCOkYU7sXVogRylJqpdggoFLG1g09Flah/7kErCxzR9HgXPYsq
0glb9cxjIz2Vsk9AmAoCSxECpD713joMKjQqLAtmMqJmXjdVvlMnMQCVITotJd1
z+fh1f1NNo+vuc1KnhWUmY7t03vydTud9BbXCtN3L2PL3bK7JCNG0GHzuZxafyB
fxevCxpm1vrwZltqw6SILCcdoCE6PGQC8wZWDA9Or7Qp5s3lAZezys0nDazs9S9
R0TjwEiksRxLkNPC1NMMWPs1bj0Ei0Yuo+JVtFLuzP1NRJ16qXWN8DhhtmS4PDg
O6mqRxs4bEJrYt087mSIow/1VzW2oFlMQuiuIy/KsUagvhdw6hSjJGlIavbLF8x
j3X47bccLcUSi0dkWh1nUZNhANT1tHKUXrNxNLbd9KPb9wDDVrKwmPQMOPQ1oy6
k5I1DwzDeRJd3jVIhDAUxq3ngzJG4CCkNXZxZVMcjefoK2J0gUY2S3rxz/RuTFx
2zHd9U+obimJXMG4edsk/2j5pTU5G1MmzbRLxkfq5EiT1GGsidvMGzi+1goGb2l
GCrN+nGnV8xj3q3JLRDVPL96vUc7Z4aJ3TN1mVqWAMJMfG+Jxh6TQqP+92iZkCU
xtglds1AB6r0aiSHKcnFck+p/c/0CbacFLQcajGcAAAAASUVORK5CYII=
 by: Blue-Maned_Hawk - Tue, 23 Jan 2024 22:28 UTC

Scott Lurndal wrote:

> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>>On 22/01/2024 23:36, Lawrence D'Oliveiro wrote:
>>> On Mon, 22 Jan 2024 23:25:22 -0000 (UTC), Blue-Maned_Hawk wrote:
>>>
>>>> I've only ever done chained strcat calls, e.g.
>>>> strcat(strcat(strcat(something, "blah"), "whatever"), "nonsense").
>>>
>>> You’ve got to be kidding.
>> >
>>That was why strcat retutns a pointer. It was how it was meant to be
>>used. But it never caught on.
>>
> For rather good reason. Too easy to overrun the size of the buffer.
>
> Huge security hole.

strncat

--
Blue-Maned_Hawk│shortens to
Hawk│/
blu.mɛin.dÊ°ak/
│he/him/his/himself/Mr.
blue-maned_hawk.srht.site
In this case, some interesting physical effects would destroy it.

Re: Variadic functions

<uopi9d$1fs5l$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=32922&group=comp.lang.c#32922

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Variadic functions
Date: Tue, 23 Jan 2024 23:31:57 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <uopi9d$1fs5l$2@dont-email.me>
References: <uoed9m$387sh$1@dont-email.me> <uog6fs$3klco$1@dont-email.me>
<uoga8t$3l6mu$1@dont-email.me> <Kdccf9Gr26AQrYzxL@bongo-ra.co>
<pan$b84f3$321a3e4$17747387$71cad685@invalid.invalid>
<uomu5q$uj61$2@dont-email.me> <uonteh$16sb4$2@dont-email.me>
<xVQrN.249990$Wp_8.4423@fx17.iad>
<pan$514f$ac2be24d$a46eca3d$5aa9624@invalid.invalid>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 23 Jan 2024 23:31:57 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1447830fc94e947a2abc3c473a339dfd";
logging-data="1568949"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+CObRZ2xbygK18lLru5XtW"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:kZOtzcwhAX55njjyE7EeYSMrcvg=
 by: Lawrence D'Oliv - Tue, 23 Jan 2024 23:31 UTC

On Tue, 23 Jan 2024 22:28:03 -0000 (UTC), Blue-Maned_Hawk wrote:

> strncat

If you can figure out how to use it properly.


devel / comp.lang.c / Re: Variadic functions

Pages:12345
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor