Re: Re: const qualifier violation in regex.c:re_comp()

Bruno Haible <[email protected]> Tue, 5 Oct 2004 13:08:58 +0200
Newsgroups gmane.comp.lib.gnulib.bugs,gmane.comp.version-control.cvs.bugs
Message-ID <[email protected]>
Paul Eggert wrote:
> 2004-10-04  Paul Eggert  <[email protected]>
>
> 	* regex.c (re_comp): Cast gettext return value to char *,
> 	Problem reported by Martin Neitzel via Mark D. Baushke.

That's the right fix, I agree.

The problem arose because while the gettext() function has a 'char *'
return type (although the returned string may be in read-only storage
and must not be freed!), in the !ENABLE_NLS case gettext.h uses

  # define gettext(Msgid) ((const char *) (Msgid))

This causes a warning, that is desirable in general but must be masked out
in this case.

Bruno