Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 14 Jan 2013 16:02:24 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: musl as a framework to test applications' compatibility
 with POSIX (was: NULL)

* Vasily Kulikov <segoon@...nwall.com> [2013-01-14 18:30:25 +0400]:
> 
> 1) on each call of a variadic function save the list of all types
> 2) on each call to va_arg(ap, T) check whether the current argument was
> pushed as T in the saved list
> 
> It would catch not only NULL/(void *)NULL, but also int/long or
> void*/long bugs.
> 
> Now I see that while it is possible to implement (2) in libc redefining
> va_XXX() macros, but it looks like (1) has to be implemented in compiler.
> 

this is what i mean when i wrote 'instrumentation tool' earlier
and it can be probably done in asan if it's not already there

and i agree with

#define NULL 0L

it is a valid definition for c and c++
and it does not cause unexpected failures in broken code

the only drawback i see is that some trivial errors are
not catched by the type checker in c with this definition
(using NULL in int/arithmetic context), but that's not a
big loss probably

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.