GNU bug report logs - #57604
[ef]grep usage -> POSIXLY_CORRECT?

Previous Next

Package: grep;

Reported by: Karl Berry <karl <at> freefriends.org>

Date: Mon, 5 Sep 2022 22:08:02 UTC

Severity: normal

Merged with 58502, 60257, 66582

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Simon Josefsson <simon <at> josefsson.org>
Cc: 57604 <at> debbugs.gnu.org, karl <at> freefriends.org
Subject: bug#57604: [ef]grep usage -> POSIXLY_CORRECT?
Date: Wed, 7 Sep 2022 14:26:07 -0500
On 9/7/22 03:02, Simon Josefsson via Bug reports for GNU grep wrote:
>> $ grep '\Q' /dev/null
>> grep: warning: stray \ before Q
>> $ grep '[:alpha:]' /dev/null
>> grep: character class syntax is [[:space:]], not [:space:]
> Is the use of diagnostic warnings like this supported by POSIX?

Yes, POSIX says that \Q produces undefined results, and that [:alpha:] 
can be treated as either [[:alpha:]], [:alph], or an error (the last is 
the GNU behavior).

> I'd rather have tools exit with an error code on invalid
> uses rather than issuing warning messages.

GNU grep does that for [:alpha:]. At some point it should do the same 
for \Q, as \Q's behavior is squirrelly anyway. I thought it might be too 
disruptive to do it for \Q right away so in 3.8 \Q merely gets warned about.





This bug report was last modified 1 year and 299 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.