bug-cvs
[Top][All Lists]
Advanced

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

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


From: Paul Eggert
Subject: Re: const qualifier violation in regex.c:re_comp()
Date: Mon, 04 Oct 2004 14:08:57 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

> Date: Fri, 1 Oct 2004 19:51:00 +0200 (CEST)
> From: Martin Neitzel <neitzel@sco.gaertner.de>
> ...
> Description:
>       lib/regex.c has a botched const char* (un)qualification.

Can you please explain what is botched about it?  What error messages
did you get when you compiled the unpatched version?  Doesn't IRIX
gettext return "char *"?  If not, what does it return?

> | -   return gettext ("No previous regular expression");
> | +   return gettext_noop ("No previous regular expression");

Thanks, but this fix is incorrect, as it disables translation for a
string that should be translated.

I installed the following patch into gnulib, which should work around
your immediate problem, but I suspect that there's a deeper problem
that should also be looked into.

2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>

        * regex.c (re_comp): Cast gettext return value to char *,
        Problem reported by Martin Neitzel via Mark D. Baushke.
        
--- regex.c     4 Oct 2004 20:30:46 -0000       1.83
+++ regex.c     4 Oct 2004 21:00:42 -0000       1.84
@@ -7909,7 +7909,7 @@ re_comp (const char *s)
   if (!s)
     {
       if (!re_comp_buf.buffer)
-       return gettext ("No previous regular expression");
+       return (char *) gettext ("No previous regular expression");
       return 0;
     }
 




reply via email to

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