commit:     80ce8be0701650cae21c91cfe2925a5e1a208c2a
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Thu May 22 21:19:09 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 30 07:37:32 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=80ce8be0

90gcc-warnings: improve an ill-informed comment

Explain why LC_CTYPE and LC_COLLATE are adjusted in a slightly more
informative way. Further, clarify why GNU grep -a is beneficial, for it
has nothing to do with UTF-8 but, rather, the presence of NUL bytes.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/install-qa-check.d/90gcc-warnings | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/bin/install-qa-check.d/90gcc-warnings 
b/bin/install-qa-check.d/90gcc-warnings
index 0662a94637..bf749f74b6 100644
--- a/bin/install-qa-check.d/90gcc-warnings
+++ b/bin/install-qa-check.d/90gcc-warnings
@@ -147,10 +147,12 @@ gcc_warn_check() {
                #': warning: not enough variable arguments to fit a sentinel'
        )
 
-       # Force C locale to work around slow multibyte locales, bug #160234
-       # Force text mode as newer grep will treat non-ASCII (e.g. UTF-8) as
-       # binary when we run in the C locale.
        f=$(
+               # Coerce C as the character type for performance reasons, per
+               # bug #160234. Coerce C as the collation to guarantee that
+               # ranges are handled appropriately. Also, pass -a to GNU grep
+               # to prevent binary data - that is, anything containing a NUL
+               # byte - from suppressing the printing of matching lines.
                export LC_ALL= LC_COLLATE=C LC_CTYPE=C
                IFS='|'
                if [[ ${PORTAGE_LOG_FILE} == *.gz ]]; then

Reply via email to