bug-grep
[Top][All Lists]
Advanced

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

Re: [PATCH 1/3] grep: add --warnings={always,never,auto}.


From: Jim Meyering
Subject: Re: [PATCH 1/3] grep: add --warnings={always,never,auto}.
Date: Tue, 31 Aug 2010 11:48:37 +0200

Paolo Bonzini wrote:
> On Mon, Aug 30, 2010 at 21:33, Paul Eggert <address@hidden> wrote:
>> On 08/30/10 00:47, Paolo Bonzini wrote:
>>> It's true that the GNU coding standards say "please don't make the
>>> behavior of the program depend on the type of output device it is used
>>> with".  On the other hand they also say "Compatibility requires certain
>>> programs to depend on the type of output device."
>>
>> But in this case we're talking about new behavior.  No other grep
>> implementation outputs warnings for dubious-but-POSIXLY-correct
>> patterns, right?  So there's no issue about compatibility with
>> other greps.
>
> It's about compatibility with the generic principles set by POSIX.
>
>> How about this idea instead?  If POSIXLY_CORRECT is set, output
>> no warnings and behave as grep has done for ages.  Otherwise,
>> if a dubious regular expression is found, output a diagnostic and
>> exit with status 2.
>
> No, I totally don't like this.  -Werror is not the default in GCC, and
> for a reason.

Hi Paolo,

I was wondering why you chose not to make grep exit with status 2
from the beginning.  There is no legitimate use for the type of
regular expression that would evoke this failure, so it is unfair
to compare grep's new warning with gcc's -Werror, which can be
triggered for valid and useful constructs.

In line with my personal preferences [if I make the mistake, I want to
find out as soon as possible], I think we should make grep work as
Paul suggests.  The value/risk ratio of such a change is unusually high,
since the likelihood of a valid use triggering an unwarranted failure
is so low, and the typo of omitting the outer [...] in e.g., "[[:lower:]]"
is so common.

I don't see what concern could make you object to this change.



reply via email to

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