This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 0/2] Fix attributes for fortify functions


On Wed, Aug 29, 2012 at 04:10:06PM +0200, Andreas Jaeger wrote:
> On Wednesday, August 29, 2012 13:51:15 Marek Polacek wrote:
> > On Wed, Aug 29, 2012 at 03:53:29AM +0400, Dmitry V. Levin wrote:
> > > This commit glibc-2.15-685-g5ac3ea1 introduced a regression:
> > > 
> > > $ echo '#include <stdlib.h>' |gcc-4.1 -O2 -D_FORTIFY_SOURCE=2 -S
> > > -xc++ - -o /dev/null /usr/include/bits/stdlib.h:36: error: expected
> > > constructor, destructor, or type conversion before 'char'
> > > /usr/include/stdlib.h:972: error: expected `}' at end of input
> > Ouch.  That's because when __cplusplus and !__GNUC_PREREQ (4,3), we
> > never define __extern_always_inline.  This quick hack ought to "fix"
> > it.  Sorry.
> > 
> > --- libc/misc/sys/cdefs.h.mp2	2012-08-29 13:45:23.975696658 +0200
> > +++ libc/misc/sys/cdefs.h	2012-08-29 13:47:49.643063131 +0200
> > @@ -331,6 +331,12 @@
> >  # endif
> >  #endif
> > 
> > +#if defined __cplusplus && !__GNUC_PREREQ (4,3)
> > +# define __extern_inline extern __inline __attribute__
> > ((__gnu_inline__)) +# define __extern_always_inline \
> > +  extern __always_inline __attribute__ ((__gnu_inline__))
> > +#endif
> > +
> >  /* GCC 4.3 and above allow passing all anonymous arguments of an
> >     __extern_always_inline function to some other vararg function.  */
> > #if __GNUC_PREREQ (4,3)
> 
> That defines it for any compiler, even non-gcc ones.

It probably fixes bug #13741 as well.

> Let's check and try to fix all cases if possible:
> * We miss the !__cplusplus && GCC && GCC < 4.3 (the one you make above)
> * We also miss the !__cplusplus && any other compiler
> 
> Note: I would prefer a patch that handles non-GCC compilers but this is 
> not a requirement. If you make it as above, add a comment so that it's 
> clear what you do...
> 
> Btw. I suggest to file a bugreport for this and fix this for 2.16 as well.

Filed #14530.


-- 
ldv

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]