tinycc-devel
[Top][All Lists]
Advanced

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

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


From: Pascal Cuoq
Subject: Re: [Tinycc-devel] match formats and arguments exactly
Date: Fri, 21 Jun 2019 14:47:09 +0000


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]