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: Paul Eggert
Subject: Re: [PATCH 1/3] grep: add --warnings={always,never,auto}.
Date: Mon, 30 Aug 2010 12:33:57 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6

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.

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.

The documentation should explicitly state that dubious regular
expressions are errors unless POSIXLY_CORRECT is set.  This
satisfies the the GNU coding standards and conforms to POSIX,
and it should work well in practice.



reply via email to

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