* config.guess (set_cc_for_build): Disable SC2039 ("In POSIX sh,

RANDOM is undefined").
	* Makefile (shellcheck): Don't disable SC2039 globally.
This commit is contained in:
Ben Elliston 2018-07-13 21:43:28 +10:00
parent a4b36a6939
commit 09da403c82
3 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2018-07-13 Ben Elliston <bje@gnu.org>
* config.guess (set_cc_for_build): Disable SC2039 ("In POSIX sh,
RANDOM is undefined").
* Makefile (shellcheck): Don't disable SC2039 globally.
2018-07-13 Ben Elliston <bje@gnu.org>
* config.guess: Disable SC2154 and SC2172 Shellcheck warnings.

View File

@ -17,4 +17,4 @@ check-sub:
cd testsuite && sh config-sub.sh
shellcheck:
shellcheck -e SC2006,SC2039 -f gcc config.guess config.sub testsuite/*.sh
shellcheck -e SC2006 -f gcc config.guess config.sub testsuite/*.sh

1
config.guess vendored
View File

@ -101,6 +101,7 @@ trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0
set_cc_for_build() {
: "${TMPDIR=/tmp}"
# shellcheck disable=SC2039
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||