I've run across a bug in the script ax_cflags_warn_all.m4 when testing on
Tru64 (OSF/1) when using the Compaq C (previously Digital C) compiler.
The script is meant to determine which flags to use to enable all
warnings. On the platform described, it always selects the Intel flags
for a very odd reason.
Compaq C, when it encounters an unknown flag starting with either "W" or
"w," passes the flag to the linker when linking is requested. If the user
is just compiling, no action is taken. Therefore, the C compiler will
accept the flags "-warn all" which is Intel-specific. However, if linking
were requested, an error is raised correctly.
In order to properly test the Compaq C compiler's accepted flag, linking
has to be tested as well. Based on the most up-to-date version of
ax_cflags_warn_all.m4, changing lines 81-82 from:
AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
to:
AC_LINK_IFELSE([AC_LANG_PROGRAM],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
fixes the problem for Compaq C without actually causing any further
problems on other compilers. A simple patch is included.
I realize Compaq C is a niche and obsolete system at this point, but the
fix is neccesary to support the compiler.
I appreciate your time, and please let me know if I can provide any
further information.
Jeff Armstrong - j...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org
--- a/ax_cflags_warn_all.m4 2016-06-26 09:27:28.859816334 -0400
+++ b/ax_cflags_warn_all.m4 2016-06-26 09:24:33.240950362 -0400
@@ -78,7 +78,7 @@
"-h conform % -h msglevel 2" dnl Cray C (Unicos)
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"