>>>>> On Sun, 12 Oct 2014, Dan Douglas wrote: > On Sun, Oct 12, 2014 at 11:22 AM, Anthony G. Basile <[email protected]> > wrote: >> +# Returns true if gcc builds with fstack-check >> +gcc-specs-stack-check() { >> + local directive >> + directive=$(gcc-specs-directive cc1) >> + return $([[ "${directive/\{!fno-stack-check:}" != "${directive}" ]]) >> +}
> Am I missing something here? I don't see how any of the tests used
> in gcc-specs-* functions could possibly produce an output. The fact
> that this coincidentally works in Bash shouldn't be relied upon.
The command produces no output, so return is effectively called
without argument. Therefore it will return with the status of the last
command executed, which is [[ ]] ...
It would be clearer if the last line of the function was simply this:
[[ "${directive/\{!fno-stack-check:}" != "${directive}" ]]
Ulrich
pgp5bzkWq7Phg.pgp
Description: PGP signature
