[PATCH] vfprint: validate nargs and argument-based offsets

Ryan S. Arnold ryan.arnold@gmail.com
Thu Feb 2 19:13:00 GMT 2012


On Thu, Feb 2, 2012 at 1:01 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> +  if (sizeof(long) == 4)
>
> We eschew implicit "int", i.e. use "long int" instead of "long".
>
> Contrary to what Ryan said, I think it's generally preferable to use if
> rather than #if whenever you can.  That avoids compile-time bit rot in the
> code path that someone doesn't remember to update and doesn't always test.

Good to know your thoughts on this going forward.  I actually grepped
through the source and didn't find any tests with precedence for a
runtime check but I'll do/recommend this in the future.

Ryan S. Arnold



More information about the Libc-alpha mailing list