[PATCH] Shut up a warning in sysconf.c (take 2)
Jakub Jelinek
jakub@redhat.com
Tue Dec 7 21:03:00 GMT 2004
On Tue, Dec 07, 2004 at 12:54:33PM -0800, Roland McGrath wrote:
> Can you replace that repeated #if mess with just one that defines a single
> macro for the other to test?
Sure. I was too lazy, sorry.
2004-12-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/posix/sysconf.c (__sysconf_check_spec): Only define
if it will be actually used.
--- libc/sysdeps/posix/sysconf.c.jj 2004-12-06 12:44:16.000000000 +0100
+++ libc/sysdeps/posix/sysconf.c 2004-12-07 22:01:24.312738283 +0100
@@ -34,7 +34,14 @@
#include <regex.h>
+#define NEED_CHECK_SPEC \
+ (!defined _XBS5_ILP32_OFF32 || !defined _XBS5_ILP32_OFFBIG \
+ || !defined _XBS5_LP64_OFF64 || !defined _XBS5_LPBIG_OFFBIG \
+ || !defined _POSIX_V6_ILP32_OFF32 || !defined _POSIX_V6_ILP32_OFFBIG \
+ || !defined _POSIX_V6_LP64_OFF64 || !defined _POSIX_V6_LPBIG_OFFBIG)
+#if NEED_CHECK_SPEC
static long int __sysconf_check_spec (const char *spec);
+#endif
/* Get the value of the system variable NAME. */
@@ -1210,6 +1217,7 @@ __sysconf (name)
weak_alias (__sysconf, sysconf)
libc_hidden_def (__sysconf)
+#if NEED_CHECK_SPEC
static long int
__sysconf_check_spec (const char *spec)
{
@@ -1230,3 +1238,4 @@ __sysconf_check_spec (const char *spec)
__set_errno (save_errno);
return ret;
}
+#endif
Jakub
More information about the Libc-hacker
mailing list