+2002-11-14 Kevin Ryde <user42@zip.com.au>
+
+ * lib/autoconf/c.m4 (AC_LANG_FUNC_LINK_TRY(C)): Initialize f=$1 rather
+ than assigning in main, to avoid HP cc +O3 optimizing it away.
+
2002-11-12 Peter Eisentraut <peter_e@gmx.net>
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Add -q
# Don't include <ctype.h> because on OSF/1 3.0 it includes
# <sys/types.h> which includes <sys/select.h> which contains a
# prototype for select. Similarly for bzero.
+#
+# This test used to assign f=$1 in main(), but that was optimized away by HP
+# unbundled cc A.05.36 for ia64 under +O3, presumably on the basis that
+# there's no need to do that store if the program is about to exit.
+#
m4_define([AC_LANG_FUNC_LINK_TRY(C)],
[AC_LANG_PROGRAM(
[/* System header to define __stub macros and hopefully few prototypes,
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $1 ();
-char (*f) ();
-#ifdef __cplusplus
-}
-#endif
-],
-[/* The GNU C library defines this for functions which it implements
+/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$1) || defined (__stub___$1)
choke me
#else
-f = $1;
+char (*f) () = $1;
+#endif
+#ifdef __cplusplus
+}
#endif
])])