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:19:10 +0000


On 21 Jun 2019, at 15:33, Christian Jullien <address@hidden> wrote:

If I read you correctly, you want to protest if type does not strictly match format directive.

I'm not protesting, I'm just offering a patch (in a series of patches) that makes the TCC source code free of easily avoided undefined behavior.

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

  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




reply via email to

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