bug-grep
[Top][All Lists]
Advanced

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

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


From: Claudio Fontana
Subject: Re: PARAMS, gnulib update and const, mbsupport [bug-grep]
Date: Thu, 31 Mar 2005 15:40:13 +0200 (CEST)

Hello all,

--- Charles Levert <address@hidden> wrote:
> Paul Eggert wrote:
> > Claudio Fontana <address@hidden> wrote:
> > > search.c:178: warning: passing arg 1 of
`wcrtomb'
> > > discards qualifiers from pointer target type

[cut]

> > 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.

This depends on whether those patches are included.
The issues with const add to the necessity to rethink
those two points in the code imo.

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

In my opinion the code in the patch is not wonderful.
For example the if (MB_CUR_MAX > 1 && !using_utf8)
block should be a function in itself to avoid lots of
code dup.
Would it be possible to separate all MBS stuff in a
separate file, like mbsupport.c ?

Claudio



                
___________________________________ 
Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam, 
Giochi, Rubrica… Scaricalo ora! 
http://it.messenger.yahoo.it




reply via email to

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