| Maybe you could just check for stderr output, instead of checking both
| stdout and stderr? But I don't know if compilers reliably send warning
| messages of this sort to stderr, as they should. (Sigh...)
Hm, I like the idea, but don't know if it is good or not :) Anyway,
it doesn't cost too much as is.
| >But even if we don't change the logic, the technology is dead wrong.
| >It should be
| > if ${CC-cc} -g ... 2&>1 | grep . >/dev/null; then
|
| I don't understand why this is better; could you explain? I can
| understanding changing it to
| if test "x`${CC-cc} -g ... 2&>1`" = "x"; then
| to guard against test getting confused by cc output beginning with "-".
As a general rule, you should avoid ` ` when you can, because
information is more properly passed via stdout->stdin than it is when
the sh decides that it has to parse something.
The original solution is definitely faster, but the second looks
saner.
I agree I can't find an example where the second succeeds, and the
first fails :)