[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] obstack: remove __STDC__ conditionals

From: Paul Eggert
Subject: [PATCH] obstack: remove __STDC__ conditionals
Date: Wed, 25 Jan 2012 11:12:39 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0

At the end of this messiage is a patch I imported from a pending glibc patch.

By the way, can anybody explain the following comment
in m4/include_next.m4?

  dnl gcc does not warn about some things, and on some systems (Solaris and 
  dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side
  dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead
  dnl of plain '__STDC__'.

I don't understand this, as no gnulib code seems
to use 'defined __STDC__' in that way.

obstack: remove __STDC__ conditionals
* lib/obstack.h: Remove __STDC__ conditionals, as suggested by Joseph
S. Myers in <http://cygwin.com/ml/libc-alpha/2012-01/msg00104.html>.
This leaves lib/localcharset.c, m4/iconv.m4, and a confusing comment in
m4/include_next.m4 as the only gnulib-maintained places that still
refer to __STDC__.
diff --git a/lib/obstack.h b/lib/obstack.h
index 0a1e473..b7d2404 100644
--- a/lib/obstack.h
+++ b/lib/obstack.h
@@ -253,7 +253,7 @@ extern int obstack_exit_failure;

 #define obstack_memory_used(h) _obstack_memory_used (h)
-#if defined __GNUC__ && defined __STDC__ && __STDC__
+#if defined __GNUC__
 /* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
    does not implement __extension__.  But that compiler doesn't define
    __GNUC_MINOR__.  */
@@ -405,7 +405,7 @@ __extension__                                               
      __o->next_free = __o->object_base = (char *)__obj;                 \
    else (__obstack_free) (__o, __obj); })
-#else /* not __GNUC__ or not __STDC__ */
+#else /* not __GNUC__ */

 # define obstack_object_size(h) \
  (unsigned) ((h)->next_free - (h)->object_base)
@@ -503,7 +503,7 @@ __extension__                                               
             = (h)->temp.tempint + (char *) (h)->chunk)                  \
    : (((__obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 

-#endif /* not __GNUC__ or not __STDC__ */
+#endif /* not __GNUC__ */

 #ifdef __cplusplus
 }       /* C++ */

reply via email to

[Prev in Thread] Current Thread [Next in Thread]