glibc/misc/sys
Siddhesh Poyarekar 884ddc5081 Revert to defining __extern_inline only for gcc-4.3+ (BZ #17266)
The check for only __GNUC_STDC_INLINE__ and __GNUC_GNU_INLINE__ may
not be sufficient since those flags were added during initial support
for C99 inlining semantics.  There is also a problem with always
defining __extern_inline and __extern_always_inline, since it enables
inline wrapper functions even when GNU inlining semantics are not
guaranteed.  This, along with the possibility of such wrappers using
redirection (btowc for example) could result in compiler generating an
infinitely recusrive call to the function.

In fact it was such a recursion that led to this code being written
the way it was; see:

https://bugzilla.redhat.com/show_bug.cgi?id=186410

The initial change was to fix bugs 14530 and 13741, but they can be
resolved by checking if __fortify_function and/or
__extern_always_inline are defined, as it has been done in this patch.
In addition, I have audited uses of __extern_always_inline to make
sure that none of the uses result in compilation errors.

There is however a regression in this patch for llvm, since it reverts
the llvm expectation that __GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE__
definition imply proper extern inline semantics.

2014-09-16  Siddhesh Poyarekar  <siddhesh@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>

	[BZ #17266]
	* libio/stdio.h: Check definition of __fortify_function
	instead of __extern_always_inline to include bits/stdio2.h.
	* math/bits/math-finite.h [__USE_XOPEN || __USE_ISOC99]: Also
	check if __extern_always_inline is defined.
	[__USE_MISC || __USE_XOPEN]: Likewise.
	[__USE_ISOC99] Likewise.
	* misc/sys/cdefs.h (__fortify_function): Define only if
	__extern_always_inline is defined.
	[!__cplusplus || __GNUC_PREREQ (4,3)]: Revert to defining
	__extern_always_inline and __extern_inline only for g++-4.3
	and newer or a compatible gcc.
2014-09-16 14:08:48 +05:30
..
auxv.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
cdefs.h Revert to defining __extern_inline only for gcc-4.3+ (BZ #17266) 2014-09-16 14:08:48 +05:30
dir.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
file.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
ioctl.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mman.h Combine __USE_BSD and __USE_SVID into __USE_MISC. 2014-02-12 23:41:01 +00:00
param.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
queue.h
select.h misc/sys/select.h (__FD_MASK): Avoid signed integer overflow. 2014-02-25 14:56:10 +01:00
syslog.h Combine __USE_BSD and __USE_SVID into __USE_MISC. 2014-02-12 23:41:01 +00:00
uio.h Complete _BSD_SOURCE / _SVID_source followup cleanup. 2014-02-21 21:45:26 +00:00
ustat.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
xattr.h misc/sys/xattr.h: guard against linux uapi header inclusion 2014-03-18 14:27:56 +01:00