From 564d45b5a55adeb48f69fdecb2bf4ed1f909850b Mon Sep 17 00:00:00 2001 From: Dan Cross Date: Tue, 22 Jul 2025 14:42:03 +0000 Subject: config: add $egrep Introduce a new variable set in $PLAN9/config: $egrep, which is conditionally set to either `egrep` or `grep -E`, based on platform, and use this when we want to invoke `egrep`. This works around the endless warnings from GNU grep stating that `egrep` is deprecated in favor of `grep -E`, when run on e.g. Linux. --- bin/9c | 5 +++-- bin/9l | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/9c b/bin/9c index ccfbe7e9..195fec81 100755 --- a/bin/9c +++ b/bin/9c @@ -8,6 +8,7 @@ usegcc() -O2 \ -c \ -Wall \ + -Wno-array-parameter \ -Wno-parentheses \ -Wno-missing-braces \ -Wno-switch \ @@ -23,7 +24,7 @@ usegcc() -fno-omit-frame-pointer \ -fsigned-char \ -fcommon \ - -std=c11 \ + -std=gnu11 \ " # want to put -fno-optimize-sibling-calls here but # that option only works with gcc3+ it seems @@ -56,7 +57,7 @@ quiet() ignore=$ignore'|expanded from macro' grep -v '__p9l_autolib_' "$1" | - egrep -v "$ignore" | + $egrep -v "$ignore" | sed 's/ .first use in this function.$//; s/\"\([^\"][^\"]*\)\", line \([0-9][0-9]*\)/\1:\2/g' | $(which uniq) 1>&2 # avoid built-in uniq on SunOS } diff --git a/bin/9l b/bin/9l index 2b1c5906..e3079e38 100755 --- a/bin/9l +++ b/bin/9l @@ -146,7 +146,7 @@ then grep '__p9l_autolib_[a-zA-Z0-9+-]*' | sed 's/.*__p9l_autolib_//; s/:.*//' | sort -u | - egrep -v '^(thread|draw)$' + $egrep -v '^(thread|draw)$' ` a="$a $b" done @@ -337,7 +337,7 @@ quiet() ignore=$ignore'|ld: warning: ignoring duplicate libraries:' sed 's/.*: In function `[^:]*: *//' "$1" | - egrep -v "$ignore" + $egrep -v "$ignore" } # Must use temp file to avoid pipe; pipe loses status. -- cgit v1.2.3