[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] match formats and arguments exactly

From: ian
Subject: Re: [Tinycc-devel] match formats and arguments exactly
Date: Fri, 21 Jun 2019 16:54:24 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Hi Pascal,

I *know* that (including the no-way part).
And I *know* too that this misuse is sometimes what's expected by developers...
Anyway, I don't think it's desirable that kinds of pointers are checked.
Still my humble opinion.

-- ian (address@hidden)
-- développeur compulsif
Le 21/06/2019 à 16:47, Pascal Cuoq a écrit :

On 21 Jun 2019, at 16:10, ian <address@hidden> wrote:

Hello,IMHO, considering that flexibility is what I love in C programming, and that this checking should be printf job (in that case),

Unfortunately, this is not how printf, or other variadic functions, work. The way they work is: the non-variadic arguments (in the case of printf, the format string) indicate what variadic arguments should be consumed with what type. If the types of the arguments actually passed do not match the types indicated by the non-variadic arguments, the behavior is undefined.

Not only printf, and other variadic functions, have no obligation to warn you if you misuse them, but on every existing platform (including the exotic platforms where a pointer is not a pointer), they actually have no way to warn you that you are misusing them.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]