public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Shut up a warning in sysconf.c
@ 2004-12-07 20:48 Jakub Jelinek
  2004-12-07 20:54 ` Roland McGrath
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2004-12-07 20:48 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Shut up a warning in sysconf.c
  2004-12-07 20:48 [PATCH] Shut up a warning in sysconf.c Jakub Jelinek
@ 2004-12-07 20:54 ` Roland McGrath
  2004-12-07 21:03   ` [PATCH] Shut up a warning in sysconf.c (take 2) Jakub Jelinek
  0 siblings, 1 reply; 4+ messages in thread
From: Roland McGrath @ 2004-12-07 20:54 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Ulrich Drepper, Glibc hackers

Can you replace that repeated #if mess with just one that defines a single
macro for the other to test?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Shut up a warning in sysconf.c (take 2)
  2004-12-07 20:54 ` Roland McGrath
@ 2004-12-07 21:03   ` Jakub Jelinek
  2004-12-07 21:06     ` Roland McGrath
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2004-12-07 21:03 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Ulrich Drepper, Glibc hackers

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Shut up a warning in sysconf.c (take 2)
  2004-12-07 21:03   ` [PATCH] Shut up a warning in sysconf.c (take 2) Jakub Jelinek
@ 2004-12-07 21:06     ` Roland McGrath
  0 siblings, 0 replies; 4+ messages in thread
From: Roland McGrath @ 2004-12-07 21:06 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Ulrich Drepper, Glibc hackers

> 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.

Yeah, that's always the problem with you. ;-)

> 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* sysdeps/posix/sysconf.c (__sysconf_check_spec): Only define
> 	if it will be actually used.
> 

Applied.


Thanks,
Roland

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-12-07 21:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-07 20:48 [PATCH] Shut up a warning in sysconf.c Jakub Jelinek
2004-12-07 20:54 ` Roland McGrath
2004-12-07 21:03   ` [PATCH] Shut up a warning in sysconf.c (take 2) Jakub Jelinek
2004-12-07 21:06     ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).