|
From: | Pascal Cuoq |
Subject: | Re: [Tinycc-devel] match formats and arguments exactly |
Date: | Fri, 21 Jun 2019 14:19:10 +0000 |
I admit I'm not very interested in knowing whether GCC warns or not for the things I am fixing, because GCC neither warns for everything that's undefined nor limits its warnings to things that are undefined. The C standards are my reference, in this case, https://port70.net/~nsz/c/c11/n1570.html#7.21.6.1p8
, which says:
7.21.6.1:8
o,u,x,X
The unsigned int argument is
…
s
If no l length modifier is present, the argument shall be a pointer to the initial element of an array of character type. …
7.21.6.1:9
… If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
I was asking about the patch because I have encountered developers who prefer to keep their invalid pointer arithmetic, uses of uninitialized memory and misuse of printf, in which case I don't insist.
Pascal
|
[Prev in Thread] | Current Thread | [Next in Thread] |