[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] fix build failure in gawk-3.1.5 (xmalloc in hard-locale.h)
From: |
Paul Eggert |
Subject: |
Re: [patch] fix build failure in gawk-3.1.5 (xmalloc in hard-locale.h) |
Date: |
Sun, 04 Sep 2005 17:07:10 -0700 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
(I'm CC'ing this to bug-gawk since it's the suggested bug-reporting
address for gawk.)
Sorry if I'm asking a stupid question, but is there any reason Gawk
doesn't simply use gnulib's hard-locale module? That module doesn't
have the bug in question.
I'm asking because, if there is a good reason to differ, I'd like to
improve the hard-locale module so that other programs could benefit
from Gawk's ideas on the subject (also, Gawk could share the code
rather than maintain it independently).
Mike Frysinger <address@hidden> writes:
> attempts to build gawk-3.1.5 on non-glibc systems with nls support enabled
> and
> newer compilers results in a build failure:
>
> hard-locale.h: In function 'hard_locale':
> hard-locale.h:43: error: invalid storage class for function 'xmalloc'
>
> this is due to declaring the prototype for the xmalloc function inline in the
> hard_locale function ... simply moving it outside of the function allows the
> build to complete successfully ...
>
> patch attached
> -mike
>
> Sat Sep 3 16:03:25 EDT 2005 Kito Danya Dietrich <address@hidden>
>
> * hard-locale.h (hard_locale): Declare xmalloc in global scope rather
> than
> function scope which gcc-4.x rejects.
>
> --- gawk-3.1.5/hard-locale.h
> +++ gawk-3.1.5/hard-locale.h
> @@ -21,6 +21,7 @@
> along with this program; if not, write to the Free Software Foundation,
> Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
>
> +static ptr_t xmalloc PARAMS ((size_t n));
>
> /* Return nonzero if the current CATEGORY locale is hard, i.e. if you
> can't get away with assuming traditional C or POSIX behavior. */
> @@ -40,7 +41,6 @@
> if (strcmp (p, "C") == 0 || strcmp (p, "POSIX") == 0)
> hard = 0;
> # else
> - static ptr_t xmalloc PARAMS ((size_t n));
>
> char *locale = xmalloc (strlen (p) + 1);
> strcpy (locale, p);
> _______________________________________________
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-gnu-utils