bug-gnu-utils
[Top][All Lists]
Advanced

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

gettext 0.10.40 compatibility problem with Solaris 8 + gcc + Bash


From: Paul Eggert
Subject: gettext 0.10.40 compatibility problem with Solaris 8 + gcc + Bash
Date: Sun, 4 Nov 2001 15:31:05 -0800 (PST)

When using gettext 0.10.40 intalled on Solaris 8 to build a recent
Bash release candidate, I ran into the following problem.
/opt/reb/include/libintl.h (installed by gettext) contained the
following text:

#ifndef PARAMS
# if __STDC__ || defined __cplusplus
#  define PARAMS(args) args
# else
#  define PARAMS(args) ()
# endif
#endif

On Solaris, the system include files have the (admittedly bizarre)
convention that __STDC__ is normally zero, and GCC follows this
convention when parsing system include files.  In the above context,
libintl.h is a system include file, so __STDC__ is zero, so
PARAMS(args) is defined to be ().

Bash uses PARAMS, so this causes many of the prototypes of Bash to all
be ignored, and in some cases this leads to problems on 64-bit Solaris
8, because in Bash, prototypes are required in some cases for proper
operation on 64-bit hosts.

Bash uses the Autoconf-defined macro PROTOTYPES just for this purpose.
Also, I noticed that some code in gettext looks at __cplusplus, some
looks at __GNUC__, and some looks at neither.  This inconsistency
cannot be healthy, so I propose that the above test be consistently
rewritten to:

# if __STDC__ || defined __cplusplus || __GNUC__ || PROTOTYPES

which should keep everybody happy.  (I'm almost tempted to suggest
'#if 1'.  :-)

Here's a proposed patch.

2001-11-04  Paul Eggert  <address@hidden>

        * acconfig.h, intl/gettextP.h, intl/hash-string.h,
          intl/libgnuintl.h, intl/loadinfo.h, lib/c-ctype.h,
          lib/getline.h, lib/hash.h, lib/linebreak.h, lib/mbswidth.h,
          lib/printf.h, lib/strtol.c, lib/system.h (PARAMS):
        Use prototypes if __STDC__ || defined __cplusplus || __GNUC__
        || PROTOTYPES.  Formerly the code was inconsistent.  The
        PROTOTYPES is for GNU code that uses AC_C_PROTOTYPES.

===================================================================
RCS file: acconfig.h,v
retrieving revision 0.10.40.0
retrieving revision 0.10.40.1
diff -pu -r0.10.40.0 -r0.10.40.1
--- acconfig.h  2001/03/27 13:25:36     0.10.40.0
+++ acconfig.h  2001/11/04 22:02:09     0.10.40.1
@@ -6,7 +6,7 @@
 #define DEFAULT_OUTPUT_ALIGNMENT 1
 
 #ifndef PARAMS
-# if __STDC__
+# if __STDC__ || defined __cplusplus || __GNUC__ || PROTOTYPES
 #  define PARAMS(args) args
 # else
 #  define PARAMS(args) ()
===================================================================
RCS file: intl/gettextP.h,v
retrieving revision 0.10.40.0
retrieving revision 0.10.40.1
diff -pu -r0.10.40.0 -r0.10.40.1
--- intl/gettextP.h     2001/09/03 14:00:50     0.10.40.0
+++ intl/gettextP.h     2001/11/04 22:02:09     0.10.40.1
@@ -37,7 +37,7 @@
 /* @@ end of prolog @@ */
 
 #ifndef PARAMS
-# if __STDC__
+# if __STDC__ || defined __cplusplus || __GNUC__ || PROTOTYPES
 #  define PARAMS(args) args
 # else
 #  define PARAMS(args) ()
===================================================================
RCS file: intl/hash-string.h,v
retrieving revision 0.10.40.0
retrieving revision 0.10.40.1
diff -pu -r0.10.40.0 -r0.10.40.1
--- intl/hash-string.h  2001/09/03 14:00:50     0.10.40.0
+++ intl/hash-string.h  2001/11/04 22:02:09     0.10.40.1
@@ -19,7 +19,7 @@
 /* @@ end of prolog @@ */
 
 #ifndef PARAMS
-# if __STDC__
+# if __STDC__ || defined __cplusplus || __GNUC__ || PROTOTYPES
 #  define PARAMS(Args) Args
 # else
 #  define PARAMS(Args) ()
===================================================================
RCS file: intl/libgnuintl.h,v
retrieving revision 0.10.40.0
retrieving revision 0.10.40.1
diff -pu -r0.10.40.0 -r0.10.40.1
--- intl/libgnuintl.h   2001/09/03 14:00:50     0.10.40.0
+++ intl/libgnuintl.h   2001/11/04 22:02:09     0.10.40.1
@@ -43,7 +43,7 @@
 #endif
 
 #ifndef PARAMS
-# if __STDC__ || defined __cplusplus
+# if __STDC__ || defined __cplusplus || __GNUC__ || PROTOTYPES
 #  define PARAMS(args) args
 # else
 #  define PARAMS(args) ()
===================================================================
RCS file: intl/loadinfo.h,v
retrieving revision 0.10.40.0
retrieving revision 0.10.40.1
diff -pu -r0.10.40.0 -r0.10.40.1
--- intl/loadinfo.h     2001/09/03 14:00:50     0.10.40.0
+++ intl/loadinfo.h     2001/11/04 22:02:09     0.10.40.1
@@ -21,7 +21,7 @@
 #define _LOADINFO_H    1
 
 #ifndef PARAMS
-# if __STDC__
+# if __STDC__ || defined __cplusplus || __GNUC__ || PROTOTYPES
 #  define PARAMS(args) args
 # else
 #  define PARAMS(args) ()
===================================================================
RCS file: lib/c-ctype.h,v
retrieving revision 0.10.40.0
retrieving revision 0.10.40.1
diff -pu -r0.10.40.0 -r0.10.40.1
--- lib/c-ctype.h       2001/03/03 01:14:45     0.10.40.0
+++ lib/c-ctype.h       2001/11/04 22:02:09     0.10.40.1
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suit
 #define C_CTYPE_H
 
 #ifndef PARAMS
-# if defined (__GNUC__) || __STDC__
+# if __STDC__ || defined __cplusplus || __GNUC__ || PROTOTYPES
 #  define PARAMS(args) args
 # else
 #  define PARAMS(args) ()
===================================================================
RCS file: lib/getline.h,v
retrieving revision 0.10.40.0
retrieving revision 0.10.40.1
diff -pu -r0.10.40.0 -r0.10.40.1
--- lib/getline.h       2001/01/04 16:34:54     0.10.40.0
+++ lib/getline.h       2001/11/04 22:02:09     0.10.40.1
@@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suit
 # include <stdio.h>
 
 # ifndef PARAMS
-#  if defined (__GNUC__) || __STDC__
+#  if __STDC__ || defined __cplusplus || __GNUC__ || PROTOTYPES
 #   define PARAMS(args) args
 #  else
 #   define PARAMS(args) ()
===================================================================
RCS file: lib/hash.h,v
retrieving revision 0.10.40.0
retrieving revision 0.10.40.1
diff -pu -r0.10.40.0 -r0.10.40.1
--- lib/hash.h  2001/01/04 16:34:54     0.10.40.0
+++ lib/hash.h  2001/11/04 22:02:09     0.10.40.1
@@ -31,7 +31,7 @@ typedef struct hash_table
 hash_table;
 
 # ifndef PARAMS
-#  if defined (__GNUC__) || __STDC__
+#  if __STDC__ || defined __cplusplus || __GNUC__ || PROTOTYPES
 #   define PARAMS(Args) Args
 #  else
 #   define PARAMS(Args) ()
===================================================================
RCS file: lib/linebreak.h,v
retrieving revision 0.10.40.0
retrieving revision 0.10.40.1
diff -pu -r0.10.40.0 -r0.10.40.1
--- lib/linebreak.h     2001/04/04 13:32:22     0.10.40.0
+++ lib/linebreak.h     2001/11/04 22:02:09     0.10.40.1
@@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suit
 #define _LINEBREAK_H
 
 #ifndef PARAMS
-# if defined (__GNUC__) || __STDC__
+# if __STDC__ || defined __cplusplus || __GNUC__ || PROTOTYPES
 #  define PARAMS(args) args
 # else
 #  define PARAMS(args) ()
===================================================================
RCS file: lib/mbswidth.h,v
retrieving revision 0.10.40.0
retrieving revision 0.10.40.1
diff -pu -r0.10.40.0 -r0.10.40.1
--- lib/mbswidth.h      2001/04/04 23:01:06     0.10.40.0
+++ lib/mbswidth.h      2001/11/04 22:02:09     0.10.40.1
@@ -16,7 +16,7 @@
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifndef PARAMS
-# if defined (__GNUC__) || __STDC__
+# if __STDC__ || defined __cplusplus || __GNUC__ || PROTOTYPES
 #  define PARAMS(Args) Args
 # else
 #  define PARAMS(Args) ()
===================================================================
RCS file: lib/printf.h,v
retrieving revision 0.10.40.0
retrieving revision 0.10.40.1
diff -pu -r0.10.40.0 -r0.10.40.1
--- lib/printf.h        2001/03/06 14:54:14     0.10.40.0
+++ lib/printf.h        2001/11/04 22:02:09     0.10.40.1
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suit
 #endif
 
 #ifndef PARAMS
-# if defined (__GNUC__) || __STDC__
+# if __STDC__ || defined __cplusplus || __GNUC__ || PROTOTYPES
 #  define PARAMS(args) args
 # else
 #  define PARAMS(args) ()
===================================================================
RCS file: lib/system.h,v
retrieving revision 0.10.40.0
retrieving revision 0.10.40.1
diff -pu -r0.10.40.0 -r0.10.40.1
--- lib/system.h        2001/03/09 13:14:30     0.10.40.0
+++ lib/system.h        2001/11/04 22:02:09     0.10.40.1
@@ -19,7 +19,7 @@
 #define _SYSTEM_H 1
 
 #ifndef PARAMS
-# if defined (__GNUC__) || __STDC__
+# if __STDC__ || defined __cplusplus || __GNUC__ || PROTOTYPES
 #  define PARAMS(args) args
 # else
 #  define PARAMS(args) ()
===================================================================
RCS file: lib/strtol.c,v
retrieving revision 0.10.40.0
retrieving revision 0.10.40.1
diff -pu -r0.10.40.0 -r0.10.40.1
--- lib/strtol.c        2001/02/20 15:15:03     0.10.40.0
+++ lib/strtol.c        2001/11/04 22:02:09     0.10.40.1
@@ -542,7 +542,7 @@ noconv:
 
 #if _LIBC - 0 == 0
 # undef PARAMS
-# if defined (__STDC__) && __STDC__
+# if __STDC__ || defined __cplusplus || __GNUC__ || PROTOTYPES
 #  define PARAMS(Args) Args
 # else
 #  define PARAMS(Args) ()



reply via email to

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