This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 0/2] Fix attributes for fortify functions
- From: Marek Polacek <polacek at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Wed, 29 Aug 2012 13:51:15 +0200
- Subject: Re: [PATCH 0/2] Fix attributes for fortify functions
- References: <20120422181326.GA27852@redhat.com><20120424200539.7768E2C0B9@topped-with-meat.com><20120427210019.GD29144@redhat.com><20120828235329.GA30633@altlinux.org>
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)
Marek