Jason Merrill wrote:

> Well, __builtin_object_size seems to be pretty fragile magic.  To make 
> it work I guess you could add a wrapper for poll that takes a Pollfd and 
> does a reinterpret_cast, i.e.
> 
> inline int poll(Pollfd* p, nfds_t n, int t)
> {
>    return poll(reinterpret_cast<pollfd*>(p), n, t);
> }
> 
> so that you force the conversion to ignore the inheritance relationship 
> and thereby avoid the COMPONENT_REF.

That does indeed seem to work for my test case, thanks!

Given that the _FORTIFY_SOURCE documentation already states that:

  With _FORTIFY_SOURCE set to 2 some more checking is added,
  but some conforming  programs  might fail. 

I guess having to use a workaround like the above is good enough.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  ulrich.weig...@de.ibm.com

Reply via email to