[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gettext 0.10.40 compatibility problem with Solaris 8 + gcc + Bash
From: |
Bruno Haible |
Subject: |
Re: gettext 0.10.40 compatibility problem with Solaris 8 + gcc + Bash |
Date: |
Fri, 9 Nov 2001 17:50:50 +0100 (CET) |
Paul Eggert writes:
> 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.
Thanks for the detailed analysis.
> 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.
This will not solve the problem entirely. Your patch will not work for
non-GNU/autoconfed programs, compiled by a non-GNU compiler.
(Remember that even if gettext was compiled by gcc, its installed
libintl.h should be usable from within Sun cc.)
Therefore I think a better patch is to use the condition
#if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus
The kind of compiler we want to exclude is Coherent's cc which sets
__STDC__ to 0 because it cannot grok prototypes.
If you agree, I'll install that.
Bruno