bug-grep
[Top][All Lists]
Advanced

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

bug#57604: [ef]grep usage -> POSIXLY_CORRECT?


From: Paul Eggert
Subject: bug#57604: [ef]grep usage -> POSIXLY_CORRECT?
Date: Wed, 7 Sep 2022 14:26:07 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

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.






reply via email to

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