]> git.kaiwu.me - njs.git/commit
auto/cc: Use portable/POSIX 'command -v' instead of 'which'
authorZurab Kvachadze <zurabid2016@gmail.com>
Mon, 26 Jan 2026 14:54:51 +0000 (15:54 +0100)
committerDmitry Volyntsev <xeioexception@gmail.com>
Mon, 26 Jan 2026 18:03:29 +0000 (10:03 -0800)
commitd0460580f383cff55e246dc6dc90791d4be1f024
tree38707f55571cefeb9b407f5a4752a5221b9ebdc0
parentf1fa26fba0d0a96e8c6c033eb02f7329db7a74cf
auto/cc: Use portable/POSIX 'command -v' instead of 'which'

'which' is not a portable utility as it is not specified by POSIX. Since
auto/cc is already a shell script, use the more direct and portable
'command' builtin to detect $CC.

There are two bugs linked here. The first one is a downstream report of
this issue. The second one is more general information on why 'which'
usage is an issue and should be avoided.

Bug: https://bugs.gentoo.org/969288
Bug: https://bugs.gentoo.org/646588
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
auto/cc