Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
t/porting/cpphdrcheck.t: fix cc version fallback
The `unless ($ver)` check doesn't work as intended because `` `$cc -V 2>&1` `` captures stderr (intentionally, for Sun C). This means with gcc or clang `$ver` ends up containing a true-ish string, either gcc: error: unrecognized command-line option ‘-V’ gcc: fatal error: no input files compilation terminated. or clang: error: argument to '-V' is missing (expected 1 value) clang: error: no input files so the `$cc --version` fallback never runs. Checking for a non-zero exit status and the word "error" in the output seems to work reliably, though.
- Loading branch information