Ver código fonte

heed compiler warnings about checking non-defined variables in #if directives

Denis Vlasenko 15 anos atrás
pai
commit
1cfb1a3247

+ 2 - 2
libc/inet/getaddrinfo.c

@@ -716,9 +716,9 @@ gaih_inet(const char *name, const struct gaih_service *service,
 				(*pai)->ai_protocol = st2->protocol;
 				(*pai)->ai_protocol = st2->protocol;
 				(*pai)->ai_addrlen = socklen;
 				(*pai)->ai_addrlen = socklen;
 				(*pai)->ai_addr = (void *) (*pai) + sizeof(struct addrinfo);
 				(*pai)->ai_addr = (void *) (*pai) + sizeof(struct addrinfo);
-#if SALEN
+#if defined SALEN
 				(*pai)->ai_addr->sa_len = socklen;
 				(*pai)->ai_addr->sa_len = socklen;
-#endif /* SALEN */
+#endif
 				(*pai)->ai_addr->sa_family = family;
 				(*pai)->ai_addr->sa_family = family;
 
 
 #if defined __UCLIBC_HAS_IPV6__
 #if defined __UCLIBC_HAS_IPV6__

+ 1 - 1
libc/misc/fnmatch/fnmatch_old.c

@@ -15,7 +15,7 @@ License along with this library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 Cambridge, MA 02139, USA.  */
 
 
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
 # include <config.h>
 # include <config.h>
 #endif
 #endif
 
 

+ 3 - 3
libc/misc/ftw/ftw.c

@@ -105,11 +105,11 @@ char *alloca ();
 /* libc_hidden_proto(lstat) */
 /* libc_hidden_proto(lstat) */
 /* libc_hidden_proto(stat) */
 /* libc_hidden_proto(stat) */
 
 
-#if ! _LIBC && !HAVE_DECL_STPCPY && !defined stpcpy
+#if !defined _LIBC && !HAVE_DECL_STPCPY && !defined stpcpy
 char *stpcpy ();
 char *stpcpy ();
 #endif
 #endif
 
 
-#if ! _LIBC && ! defined HAVE_MEMPCPY && ! defined mempcpy
+#if !defined _LIBC && ! defined HAVE_MEMPCPY && ! defined mempcpy
 /* Be CAREFUL that there are no side effects in N.  */
 /* Be CAREFUL that there are no side effects in N.  */
 # define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
 # define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
 #endif
 #endif
@@ -162,7 +162,7 @@ extern char *xgetcwd (void);
 /* Arrange to make lstat calls go through the wrapper function
 /* Arrange to make lstat calls go through the wrapper function
    on systems with an lstat function that does not dereference symlinks
    on systems with an lstat function that does not dereference symlinks
    that are specified with a trailing slash.  */
    that are specified with a trailing slash.  */
-#if ! _LIBC && ! LSTAT_FOLLOWS_SLASHED_SYMLINK && !defined __UCLIBC__
+#if !defined _LIBC && !defined LSTAT_FOLLOWS_SLASHED_SYMLINK && !defined __UCLIBC__
 int rpl_lstat (const char *, struct stat *);
 int rpl_lstat (const char *, struct stat *);
 # undef lstat
 # undef lstat
 # define lstat(Name, Stat_buf) rpl_lstat(Name, Stat_buf)
 # define lstat(Name, Stat_buf) rpl_lstat(Name, Stat_buf)

+ 6 - 6
libc/misc/regex/regex_old.c

@@ -120,7 +120,7 @@
 # endif
 # endif
 
 
 /* This is for other GNU distributions with internationalized messages.  */
 /* This is for other GNU distributions with internationalized messages.  */
-# if HAVE_LIBINTL_H || defined _LIBC
+# if defined HAVE_LIBINTL_H || defined _LIBC
 #  include <libintl.h>
 #  include <libintl.h>
 #  ifdef _LIBC
 #  ifdef _LIBC
 #   undef gettext
 #   undef gettext
@@ -208,7 +208,7 @@ char *realloc ();
 
 
 # endif /* not emacs */
 # endif /* not emacs */
 
 
-# if defined _LIBC || HAVE_LIMITS_H
+# if defined _LIBC || defined HAVE_LIMITS_H
 #  include <limits.h>
 #  include <limits.h>
 # endif
 # endif
 
 
@@ -2230,7 +2230,7 @@ typedef struct
   }
   }
 
 
 # ifndef DEFINED_ONCE
 # ifndef DEFINED_ONCE
-#  if defined _LIBC || WIDE_CHAR_SUPPORT
+#  if defined _LIBC || defined WIDE_CHAR_SUPPORT
 /* The GNU C library provides support for user-defined character classes
 /* The GNU C library provides support for user-defined character classes
    and the functions from ISO C amendement 1.  */
    and the functions from ISO C amendement 1.  */
 #   ifdef CHARCLASS_NAME_MAX
 #   ifdef CHARCLASS_NAME_MAX
@@ -3286,7 +3286,7 @@ PREFIX(regex_compile) (
                        the leading `:' and `[' (but set bits for them).  */
                        the leading `:' and `[' (but set bits for them).  */
                     if (c == ':' && *p == ']')
                     if (c == ':' && *p == ']')
                       {
                       {
-# if defined _LIBC || WIDE_CHAR_SUPPORT
+# if defined _LIBC || defined WIDE_CHAR_SUPPORT
                         boolean is_lower = STREQ (str, "lower");
                         boolean is_lower = STREQ (str, "lower");
                         boolean is_upper = STREQ (str, "upper");
                         boolean is_upper = STREQ (str, "upper");
 			wctype_t wt;
 			wctype_t wt;
@@ -4542,7 +4542,7 @@ byte_compile_range (
   unsigned this_char;
   unsigned this_char;
   const char *p = *p_ptr;
   const char *p = *p_ptr;
   reg_errcode_t ret;
   reg_errcode_t ret;
-# if _LIBC
+# ifdef _LIBC
   const unsigned char *collseq;
   const unsigned char *collseq;
   unsigned int start_colseq;
   unsigned int start_colseq;
   unsigned int end_colseq;
   unsigned int end_colseq;
@@ -4560,7 +4560,7 @@ byte_compile_range (
   /* Report an error if the range is empty and the syntax prohibits this.  */
   /* Report an error if the range is empty and the syntax prohibits this.  */
   ret = syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
   ret = syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
 
 
-# if _LIBC
+# ifdef _LIBC
   collseq = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
   collseq = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
 						 _NL_COLLATE_COLLSEQMB);
 						 _NL_COLLATE_COLLSEQMB);
 
 

+ 1 - 1
libpthread/linuxthreads.old/attr.c

@@ -61,7 +61,7 @@ int pthread_attr_init(pthread_attr_t *attr)
 libpthread_hidden_def(pthread_attr_init)
 libpthread_hidden_def(pthread_attr_init)
 
 
 /* uClibc: leave out this for now. */
 /* uClibc: leave out this for now. */
-#if DO_PTHREAD_VERSIONING_WITH_UCLIBC
+#if defined DO_PTHREAD_VERSIONING_WITH_UCLIBC
 #if defined __PIC__ && defined DO_VERSIONING
 #if defined __PIC__ && defined DO_VERSIONING
 default_symbol_version (__pthread_attr_init_2_1, pthread_attr_init, GLIBC_2.1);
 default_symbol_version (__pthread_attr_init_2_1, pthread_attr_init, GLIBC_2.1);
 
 

+ 1 - 1
libpthread/linuxthreads.old/pthread.c

@@ -321,7 +321,7 @@ libpthread_hidden_proto(pthread_condattr_init)
 
 
 struct pthread_functions __pthread_functions =
 struct pthread_functions __pthread_functions =
   {
   {
-#if !(USE_TLS && HAVE___THREAD)
+#if !(defined USE_TLS && HAVE___THREAD)
     .ptr_pthread_internal_tsd_set = __pthread_internal_tsd_set,
     .ptr_pthread_internal_tsd_set = __pthread_internal_tsd_set,
     .ptr_pthread_internal_tsd_get = __pthread_internal_tsd_get,
     .ptr_pthread_internal_tsd_get = __pthread_internal_tsd_get,
     .ptr_pthread_internal_tsd_address = __pthread_internal_tsd_address,
     .ptr_pthread_internal_tsd_address = __pthread_internal_tsd_address,

+ 1 - 1
libpthread/linuxthreads.old/specific.c

@@ -167,7 +167,7 @@ void __pthread_destroy_specifics(void)
     __pthread_unlock(THREAD_GETMEM(self, p_lock));
     __pthread_unlock(THREAD_GETMEM(self, p_lock));
 }
 }
 
 
-#if !(USE_TLS && HAVE___THREAD)
+#if !(defined USE_TLS && HAVE___THREAD)
 
 
 /* Thread-specific data for libc. */
 /* Thread-specific data for libc. */