-diag-error doesn't return non-zero status

-diag-error doesn't return non-zero status

Hi,

I have an autoconf/configure script that's checking whether or not the c compiler accepts certain command line flags. However, by default icc doesn't consider an unknown flag an error, only issuing a remark:

configure:27287: checking whether icc accepts -W
configure:27330: icc -o conftest -g -O2 -W -I/scratch/nolta/act/gpc/include -L/scratch/nolta/act/gpc/lib conftest.c -lreadline -lncurses -ldl -lhdf5 -lz -lm >&5
icc: command line remark #10148: option '-W' not supported
configure:27336: $? = 0
configure:27363: result: yes
configure:27367: result: adding -W to WARN_CFLAGS

Even if i add "-diag-error 10148 -Wfatal-errors", the icc exit status is still 0 (i.e., no error):

configure:27287: checking whether icc accepts -W
configure:27330: icc -o conftest -diag-error 10148 -Wfatal-errors -W -I/scratch/nolta/act/gpc/include -L/scratch/nolta/act/gpc/lib conftest.c -lreadline -lncurses -ldl -lhdf5 -lz -lm >&5
icc: command line error: option '-W' not supported
configure:27336: $? = 0
configure:27363: result: yes
configure:27367: result: adding -W to WARN_CFLAGS

It seems like -diag-error should also cause the compiler to return a non-zero exit status, and not just change "remark" to "error" in stdout.

Thanks,

-Mike

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quoting - nolta

It seems like -diag-error should also cause the compiler to return a non-zero exit status, and not just change "remark" to "error" in stdout.

Hmm, that's a good point. I played around with it a bit and in some cases it does what you're expecting, at least in the case I tried where I converted a "Warning" to an error. I don't know if it's treating remarks different, or if it's the fact that it's on the command line thats different or if it's a random inconsistency. I'll ask around and see what I can find out.

Dale

I'm told that this will be fixed in a future release.

Thanks!

Dale

Leave a Comment

Please sign in to add a comment. Not a member? Join today