This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Remove oldish __GNUC_PREREQ
- From: Marek Polacek <polacek at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 28 Feb 2012 16:58:38 +0100
- Subject: [PATCH] Remove oldish __GNUC_PREREQ
This is to remove __GNUC_PREREQ macros which test for GCC < 4.3.
I tried to not touch installed headers, so here's a list of headers
which still include __GNUC_PREREQ macros that could be otherwise removed:
bits/huge_vall.h
bits/inf.h
bits/huge_val.h
bits/sched.h
bits/huge_valf.h
string/bits/string2.h
string/string.h
string/strings.h
assert/assert.h
include/features.h
math/bits/cmathcalls.h
math/complex.h
math/tgmath.h
math/math.h
posix/getopt.h
posix/sys/types.h
misc/sys/cdefs.h
sysdeps/sparc/bits/huge_vall.h
sysdeps/sparc/fpu/bits/mathinline.h
sysdeps/unix/sysv/linux/bits/sched.h
sysdeps/i386/bits/huge_vall.h
sysdeps/i386/fpu/bits/mathinline.h
sysdeps/i386/i486/bits/atomic.h
sysdeps/x86_64/bits/link.h
sysdeps/x86_64/bits/atomic.h
sysdeps/x86_64/fpu/bits/mathinline.h
sysdeps/sh/bits/huge_val.h
sysdeps/ieee754/bits/nan.h
sysdeps/ieee754/bits/inf.h
sysdeps/ieee754/bits/huge_val.h
sysdeps/ieee754/bits/huge_valf.h
sysdeps/ieee754/ldbl-128/bits/huge_vall.h
sysdeps/powerpc/fpu/bits/mathinline.h
socket/sys/socket.h
wcsmbs/wchar.h
I'm not sure about misc/sys/cdefs.h and those two atomic.h. Should
they be pruned too?
Regtested on x86_64-linux, ok for trunk?
2012-02-28 Marek Polacek <polacek@redhat.com>
* include/sys/cdefs.h: Remove __GNUC_PREREQ macro.
* math/math_private.h: Likewise.
* stdlib/tst-strtod.c: Likewise.
--- libc/include/sys/cdefs.h.mp 2012-02-28 13:55:12.450281852 +0100
+++ libc/include/sys/cdefs.h 2012-02-28 13:56:04.931382098 +0100
@@ -14,11 +14,7 @@ libc_hidden_proto (__chk_fail)
rtld_hidden_proto (__chk_fail)
-# if __GNUC_PREREQ (4,3)
-# define __attribute_alloc_size(...) __attribute__ ((alloc_size (__VA_ARGS__)))
-# else
-# define __attribute_alloc_size(...)
-# endif
+# define __attribute_alloc_size(...) __attribute__ ((alloc_size (__VA_ARGS__)))
#endif
#endif
--- libc/stdlib/tst-strtod.c.mp 2012-02-28 14:07:45.552720409 +0100
+++ libc/stdlib/tst-strtod.c 2012-02-28 14:08:16.902780292 +0100
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,1996-2001,2003,2009,2011 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1996-2001,2003,2009,2011,2012
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -64,12 +65,9 @@ static const struct ltest tests[] =
{ "0x0.8p-1022",
1.11253692925360069154511635866620203210960799023116591527666e-308,
'\0', ERANGE },
-#if __GNUC_PREREQ(2,96)
- /* For older GCC release HUGE_VAL is not a constant. */
{ "Inf", HUGE_VAL, '\0', 0 },
{ "-Inf", -HUGE_VAL, '\0', 0 },
{ "+InFiNiTy", HUGE_VAL, '\0', 0 },
-#endif
{ "0x80000Ap-23", 0x80000Ap-23, '\0', 0 },
{ "1e-324", 0, '\0', ERANGE },
{ NULL, 0, '\0', 0 }
--- libc/math/math_private.h.mp 2012-02-28 14:09:51.032960099 +0100
+++ libc/math/math_private.h 2012-02-28 14:11:25.416140386 +0100
@@ -211,10 +211,8 @@ extern int __kernel_rem_pio2 (double*
/* internal functions. */
extern double __copysign (double x, double __y);
-#if __GNUC_PREREQ (4, 0)
extern inline double __copysign (double x, double y)
{ return __builtin_copysign (x, y); }
-#endif
/* ieee style elementary float functions */
extern float __ieee754_sqrtf (float);
@@ -258,10 +256,8 @@ extern int __kernel_rem_pio2f (float*,
/* internal functions. */
extern float __copysignf (float x, float __y);
-#if __GNUC_PREREQ (4, 0)
extern inline float __copysignf (float x, float y)
{ return __builtin_copysignf (x, y); }
-#endif
/* ieee style elementary long double functions */
extern long double __ieee754_sqrtl (long double);
@@ -326,10 +322,8 @@ extern void __sincosl (long double, long
extern long double __logbl (long double x);
extern long double __significandl (long double x);
-#if __GNUC_PREREQ (4, 0)
extern inline long double __copysignl (long double x, long double y)
{ return __builtin_copysignl (x, y); }
-#endif
#endif
Marek