GNU bug report logs -
#57604
[ef]grep usage -> POSIXLY_CORRECT?
Previous Next
Full log
View this message in rfc822 format
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.