This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

[PATCH] Shut up a warning in sysconf.c


Hi!

On ia64 I get:
../sysdeps/posix/sysconf.c:1215: warning: '__sysconf_check_spec' defined but not used

The following patch seems to cure it.
I tried __attribute__((unused)) first but for some reason that still warned
(maybe compiler bug).  __attribute_used__ is not something that is desirable
in this case, as there is no point in actually having the routine if it will
be never used.

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-07 15:42:04.000000000 -0500
+++ libc/sysdeps/posix/sysconf.c	2004-12-07 15:50:38.000000000 -0500
@@ -34,7 +34,12 @@
 #include <regex.h>
 
 
+#if !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
 static long int __sysconf_check_spec (const char *spec);
+#endif
 
 
 /* Get the value of the system variable NAME.  */
@@ -1210,6 +1215,10 @@ __sysconf (name)
 weak_alias (__sysconf, sysconf)
 libc_hidden_def (__sysconf)
 
+#if !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
 static long int
 __sysconf_check_spec (const char *spec)
 {
@@ -1230,3 +1239,4 @@ __sysconf_check_spec (const char *spec)
   __set_errno (save_errno);
   return ret;
 }
+#endif


	Jakub


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