bug-grep
[Top][All Lists]
Advanced

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

Re: PARAMS, gnulib update and const [bug-grep]


From: Charles Levert
Subject: Re: PARAMS, gnulib update and const [bug-grep]
Date: Tue, 22 Mar 2005 07:48:40 -0500
User-agent: Mutt/1.4.1i

* On Monday 2005-03-21 at 23:58:34 -0800, Paul Eggert wrote:
> Claudio Fontana <address@hidden> writes:
> 
> > Sorry, forgot to cc bug-grep.
> > Here are my 2c again (Sorry Paul for the redundancy).
> >
> >> Can you give some sample violations in the GNU
> >> grep source code?
> >
> > grep.c:552: warning: assignment discards qualifiers
> >>From pointer target type
> > search.c:178: warning: passing arg 1 of `wcrtomb'
> > discards qualifiers from pointer target type
> 
> The first problem is easily fixed by adding "const" in a couple
> of places, and using "buf" rather than "ibeg"; please see the
> patch below.
> 
> The second problem is a symptom of a serious bug in search.c, that
> could lead to a buffer overrun and undefined behavior.  The code
> involved is pretty low-quality -- how did it end up in "grep"?

Having this discussion about "const" is nice;
I'm against their systematic removal myself.

However, I'd like to point out that the two
specific examples cited here are (at least
tentatively) slated for removal anyway and that
producing patches against them seems like a
waste of time.

The "first problem" code is inappropriate
anyway because of its use of non-wide
tolower(); this code is removed by
<https://savannah.gnu.org/patch/?func=detailitem&item_id=3767>.

The "second problem" code is removed by
<https://savannah.gnu.org/patch/?func=detailitem&item_id=3803>.




reply via email to

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