[LLVMdev] PATCH: AddressSanitizer: Fix errors about mis-matched exception specifiers for intercepted libc functions on Linux

Chandler Carruth chandlerc at google.com
Mon Jun 25 03:14:12 PDT 2012


On Mon, Jun 25, 2012 at 2:42 AM, Alexander Potapenko <glider at google.com>wrote:

> On Mon, Jun 25, 2012 at 1:10 PM, Chandler Carruth <chandlerc at google.com>
> wrote:
> > Hello,
> >
> > On modern Linux installs, glibc has a very annoying practice: it adds an
> > empty exception specifier to lots of libc functions as an optimization.
> It
> > only does this if the compiler is modern and GCC-like, and we are
> compiling
> > in C++ mode.
> >
> > This, however, causes GCC to complain about signature mismatches between
> the
> > glibc functions declared in malloc.h and those defined as an alias in the
> > interceptors library:
> >
> > ..../asan_malloc_linux.cc:57:1: error: declaration of 'void free(void*)'
> has
> > a different exception specifier
> > /usr/include/malloc.h:66:13: error: from previous declaration 'void
> > free(void*) throw ()'
> Looking at /usr/include/malloc.h I don't see any instances of throw()
> (Goobuntu Lucid)
> Shouldn't we have the same set of standard headers?
>

Ahem, not everyone works where we do? ;]

I'm testing this on a very generic Linux box. I think you'll find that the
preprocessed source of malloc.h does include throw(). It's burried inside
of MALLOC_P, other macros, __THROW, etc. But eventually it gets there.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120625/7df7f1d1/attachment.html>


More information about the llvm-dev mailing list