@@ -2432,23 +2432,61 @@ else
24322432 fi
24332433fi
24342434
2435- # Need to specify -fno-strict-aliasing too in case it's gcc 3.3 or later.
2436- echo "$as_me:$LINENO: checking how to turn off strict aliasing in $CC" >&5
2437- echo $ECHO_N "checking how to turn off strict aliasing in $CC... $ECHO_C" >&6
2438- if test "${pgac_cv_prog_cc_no_strict_aliasing+set}" = set; then
2439- echo $ECHO_N "(cached) $ECHO_C" >&6
2440- else
2441- pgac_save_CFLAGS=$CFLAGS
24422435if test "$GCC" = yes; then
2443- pgac_try="-fno-strict-aliasing"
2436+ CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith"
2437+
2438+ # Some versions of GCC support some additional useful warning flags.
2439+ # Check whether they are supported, and add them to CFLAGS if so.
2440+ echo "$as_me:$LINENO: checking if $CC supports -Wdeclaration-after-statement" >&5
2441+ echo $ECHO_N "checking if $CC supports -Wdeclaration-after-statement... $ECHO_C" >&6
2442+ pgac_save_CFLAGS=$CFLAGS
2443+ CFLAGS="$pgac_save_CFLAGS -Wdeclaration-after-statement"
2444+ cat >conftest.$ac_ext <<_ACEOF
2445+ #line $LINENO "configure"
2446+ #include "confdefs.h"
2447+
2448+ #ifdef F77_DUMMY_MAIN
2449+ # ifdef __cplusplus
2450+ extern "C"
2451+ # endif
2452+ int F77_DUMMY_MAIN() { return 1; }
2453+ #endif
2454+ int
2455+ main ()
2456+ {
2457+
2458+ ;
2459+ return 0;
2460+ }
2461+ _ACEOF
2462+ rm -f conftest.$ac_objext
2463+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2464+ (eval $ac_compile) 2>&5
2465+ ac_status=$?
2466+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
2467+ (exit $ac_status); } &&
2468+ { ac_try='test -s conftest.$ac_objext'
2469+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2470+ (eval $ac_try) 2>&5
2471+ ac_status=$?
2472+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
2473+ (exit $ac_status); }; }; then
2474+ echo "$as_me:$LINENO: result: yes" >&5
2475+ echo "${ECHO_T}yes" >&6
24442476else
2445- # Maybe fill in later...
2446- pgac_try=
2477+ echo "$as_me: failed program was:" >&5
2478+ cat conftest.$ac_ext >&5
2479+ CFLAGS="$pgac_save_CFLAGS"
2480+ echo "$as_me:$LINENO: result: no" >&5
2481+ echo "${ECHO_T}no" >&6
24472482fi
2483+ rm -f conftest.$ac_objext conftest.$ac_ext
24482484
2449- for pgac_flag in $pgac_try; do
2450- CFLAGS="$pgac_save_CFLAGS $pgac_flag"
2451- cat >conftest.$ac_ext <<_ACEOF
2485+ echo "$as_me:$LINENO: checking if $CC supports -Wold-style-definition" >&5
2486+ echo $ECHO_N "checking if $CC supports -Wold-style-definition... $ECHO_C" >&6
2487+ pgac_save_CFLAGS=$CFLAGS
2488+ CFLAGS="$pgac_save_CFLAGS -Wold-style-definition"
2489+ cat >conftest.$ac_ext <<_ACEOF
24522490#line $LINENO "configure"
24532491#include "confdefs.h"
24542492
@@ -2478,23 +2516,109 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
24782516 ac_status=$?
24792517 echo "$as_me:$LINENO: \$? = $ac_status" >&5
24802518 (exit $ac_status); }; }; then
2481- pgac_cv_prog_cc_no_strict_aliasing=$pgac_try
2482- break
2519+ echo "$as_me:$LINENO: result: yes" >&5
2520+ echo "${ECHO_T}yes" >&6
24832521else
24842522 echo "$as_me: failed program was:" >&5
24852523cat conftest.$ac_ext >&5
2524+ CFLAGS="$pgac_save_CFLAGS"
2525+ echo "$as_me:$LINENO: result: no" >&5
2526+ echo "${ECHO_T}no" >&6
24862527fi
24872528rm -f conftest.$ac_objext conftest.$ac_ext
2488- done
24892529
2490- CFLAGS=$pgac_save_CFLAGS
2530+ echo "$as_me:$LINENO: checking if $CC supports -Wendif-labels" >&5
2531+ echo $ECHO_N "checking if $CC supports -Wendif-labels... $ECHO_C" >&6
2532+ pgac_save_CFLAGS=$CFLAGS
2533+ CFLAGS="$pgac_save_CFLAGS -Wendif-labels"
2534+ cat >conftest.$ac_ext <<_ACEOF
2535+ #line $LINENO "configure"
2536+ #include "confdefs.h"
2537+
2538+ #ifdef F77_DUMMY_MAIN
2539+ # ifdef __cplusplus
2540+ extern "C"
2541+ # endif
2542+ int F77_DUMMY_MAIN() { return 1; }
2543+ #endif
2544+ int
2545+ main ()
2546+ {
24912547
2548+ ;
2549+ return 0;
2550+ }
2551+ _ACEOF
2552+ rm -f conftest.$ac_objext
2553+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2554+ (eval $ac_compile) 2>&5
2555+ ac_status=$?
2556+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
2557+ (exit $ac_status); } &&
2558+ { ac_try='test -s conftest.$ac_objext'
2559+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2560+ (eval $ac_try) 2>&5
2561+ ac_status=$?
2562+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
2563+ (exit $ac_status); }; }; then
2564+ echo "$as_me:$LINENO: result: yes" >&5
2565+ echo "${ECHO_T}yes" >&6
2566+ else
2567+ echo "$as_me: failed program was:" >&5
2568+ cat conftest.$ac_ext >&5
2569+ CFLAGS="$pgac_save_CFLAGS"
2570+ echo "$as_me:$LINENO: result: no" >&5
2571+ echo "${ECHO_T}no" >&6
2572+ fi
2573+ rm -f conftest.$ac_objext conftest.$ac_ext
2574+
2575+
2576+ # Disable strict-aliasing rules; needed for gcc 3.3+
2577+ echo "$as_me:$LINENO: checking if $CC supports -fno-strict-aliasing" >&5
2578+ echo $ECHO_N "checking if $CC supports -fno-strict-aliasing... $ECHO_C" >&6
2579+ pgac_save_CFLAGS=$CFLAGS
2580+ CFLAGS="$pgac_save_CFLAGS -fno-strict-aliasing"
2581+ cat >conftest.$ac_ext <<_ACEOF
2582+ #line $LINENO "configure"
2583+ #include "confdefs.h"
2584+
2585+ #ifdef F77_DUMMY_MAIN
2586+ # ifdef __cplusplus
2587+ extern "C"
2588+ # endif
2589+ int F77_DUMMY_MAIN() { return 1; }
2590+ #endif
2591+ int
2592+ main ()
2593+ {
2594+
2595+ ;
2596+ return 0;
2597+ }
2598+ _ACEOF
2599+ rm -f conftest.$ac_objext
2600+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2601+ (eval $ac_compile) 2>&5
2602+ ac_status=$?
2603+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
2604+ (exit $ac_status); } &&
2605+ { ac_try='test -s conftest.$ac_objext'
2606+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2607+ (eval $ac_try) 2>&5
2608+ ac_status=$?
2609+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
2610+ (exit $ac_status); }; }; then
2611+ echo "$as_me:$LINENO: result: yes" >&5
2612+ echo "${ECHO_T}yes" >&6
2613+ else
2614+ echo "$as_me: failed program was:" >&5
2615+ cat conftest.$ac_ext >&5
2616+ CFLAGS="$pgac_save_CFLAGS"
2617+ echo "$as_me:$LINENO: result: no" >&5
2618+ echo "${ECHO_T}no" >&6
24922619fi
2493- echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_no_strict_aliasing" >&5
2494- echo "${ECHO_T}$pgac_cv_prog_cc_no_strict_aliasing" >&6
2620+ rm -f conftest.$ac_objext conftest.$ac_ext
24952621
2496- if test x"$pgac_cv_prog_cc_no_strict_aliasing" != x""; then
2497- CFLAGS="$CFLAGS $pgac_cv_prog_cc_no_strict_aliasing"
24982622fi
24992623
25002624# supply -g if --enable-debug
0 commit comments