Author: jkeenan
Date: Wed Oct 31 16:00:52 2007
New Revision: 22646

Added:
   trunk/t/configure/111-auto_gcc-01.t
      - copied unchanged from r22645, 
/branches/autogcc/t/configure/111-auto_gcc-01.t
   trunk/t/configure/111-auto_gcc-02.t
      - copied unchanged from r22645, 
/branches/autogcc/t/configure/111-auto_gcc-02.t
   trunk/t/configure/111-auto_gcc-03.t
      - copied unchanged from r22645, 
/branches/autogcc/t/configure/111-auto_gcc-03.t
   trunk/t/configure/111-auto_gcc-04.t
      - copied unchanged from r22645, 
/branches/autogcc/t/configure/111-auto_gcc-04.t
   trunk/t/configure/111-auto_gcc-05.t
      - copied unchanged from r22645, 
/branches/autogcc/t/configure/111-auto_gcc-05.t
   trunk/t/configure/111-auto_gcc-06.t
      - copied unchanged from r22645, 
/branches/autogcc/t/configure/111-auto_gcc-06.t
   trunk/t/configure/111-auto_gcc-07.t
      - copied unchanged from r22645, 
/branches/autogcc/t/configure/111-auto_gcc-07.t
   trunk/t/configure/111-auto_gcc-08.t
      - copied unchanged from r22645, 
/branches/autogcc/t/configure/111-auto_gcc-08.t
   trunk/t/configure/111-auto_gcc-09.t
      - copied unchanged from r22645, 
/branches/autogcc/t/configure/111-auto_gcc-09.t
   trunk/t/configure/111-auto_gcc-10.t
      - copied unchanged from r22645, 
/branches/autogcc/t/configure/111-auto_gcc-10.t
   trunk/t/configure/111-auto_gcc-11.t
      - copied unchanged from r22645, 
/branches/autogcc/t/configure/111-auto_gcc-11.t
   trunk/t/configure/111-auto_gcc-12.t
      - copied unchanged from r22645, 
/branches/autogcc/t/configure/111-auto_gcc-12.t
   trunk/t/configure/111-auto_gcc-13.t
      - copied unchanged from r22645, 
/branches/autogcc/t/configure/111-auto_gcc-13.t
Removed:
   trunk/t/configure/111-auto_gcc.t
Modified:
   trunk/MANIFEST
   trunk/config/auto/gcc.pm
   trunk/t/configure/114-auto_attributes.t

Log:
Merge autogcc branch into trunk.  Refactor config/auto/gcc.pm to
increase testability.  Add 13 test files; remove placeholder test file
Updated MANIFEST.  Cf.:
https://rt.perl.org/rt3/Ticket/Display.html?id=43329.


Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST      (original)
+++ trunk/MANIFEST      Wed Oct 31 16:00:52 2007
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Oct 31 01:48:56 2007 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Wed Oct 31 22:48:47 2007 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -3013,7 +3013,19 @@
 t/configure/110-inter_yacc-03.t                             []
 t/configure/110-inter_yacc-04.t                             []
 t/configure/110-inter_yacc-05.t                             []
-t/configure/111-auto_gcc.t                                  []
+t/configure/111-auto_gcc-01.t                               []
+t/configure/111-auto_gcc-02.t                               []
+t/configure/111-auto_gcc-03.t                               []
+t/configure/111-auto_gcc-04.t                               []
+t/configure/111-auto_gcc-05.t                               []
+t/configure/111-auto_gcc-06.t                               []
+t/configure/111-auto_gcc-07.t                               []
+t/configure/111-auto_gcc-08.t                               []
+t/configure/111-auto_gcc-09.t                               []
+t/configure/111-auto_gcc-10.t                               []
+t/configure/111-auto_gcc-11.t                               []
+t/configure/111-auto_gcc-12.t                               []
+t/configure/111-auto_gcc-13.t                               []
 t/configure/112-auto_backtrace-01.t                         []
 t/configure/112-auto_backtrace-02.t                         []
 t/configure/113-auto_msvc-01.t                              []

Modified: trunk/config/auto/gcc.pm
==============================================================================
--- trunk/config/auto/gcc.pm    (original)
+++ trunk/config/auto/gcc.pm    Wed Oct 31 16:00:52 2007
@@ -32,34 +32,37 @@
 
 sub runstep {
     my ( $self, $conf ) = @_;
+    my $gnucref = _probe_for_gcc();
+    my $rv = $self->_evaluate_gcc($conf, $gnucref);
+    return $rv;
+}
 
-    my $verbose = $conf->options->get('verbose');
-    my $maint   = $conf->options->get('maintainer');
-
-    my %gnuc;
-
+sub _probe_for_gcc {
     cc_gen("config/auto/gcc/test_c.in");
     cc_build();
-    %gnuc = eval cc_run() or die "Can't run the test program: $!";
+    my %gnuc = eval cc_run() or die "Can't run the test program: $!";
     cc_clean();
+    return \%gnuc;
+}
 
-    my ( $gccversion, $warns, $ccwarn );
-    $ccwarn = $conf->data->get('ccwarn');
+sub _evaluate_gcc {
+    my ($self, $conf, $gnucref) = @_;
 
     # Set gccversion to undef.  This will also trigger any hints-file
     # callbacks that depend on knowing whether or not we're using gcc.
 
     # This key should always exist unless the program couldn't be run,
     # which should have been caught by the 'die' above.
-    unless ( exists $gnuc{__GNUC__} ) {
+    unless ( exists $gnucref->{__GNUC__} ) {
         $conf->data->set( gccversion => undef );
         return 1;
     }
 
-    my $major = $gnuc{__GNUC__};
-    my $minor = $gnuc{__GNUC_MINOR__};
-    my $intel = $gnuc{__INTEL_COMPILER};
+    my $major = $gnucref->{__GNUC__};
+    my $minor = $gnucref->{__GNUC_MINOR__};
+    my $intel = $gnucref->{__INTEL_COMPILER};
 
+    my $verbose = $conf->options->get('verbose');
     if ( defined $intel || !defined $major ) {
         print " (no) " if $verbose;
         $self->set_result('no');
@@ -72,329 +75,332 @@
     if ( defined $minor and $minor =~ tr/0-9//c ) {
         undef $minor;    # Don't use it
     }
-    if ( defined $major ) {
-        $gccversion = $major;
-        $gccversion .= ".$minor" if defined $minor;
+    if ( ! defined $major ) {
+        print " (no) " if $verbose;
+        $self->set_result('no');
+        $conf->data->set( gccversion => undef );
+        return 1;
     }
+    my $gccversion = $major;
+    $gccversion .= ".$minor" if defined $minor;
     print " (yep: $gccversion )" if $verbose;
     $self->set_result('yes');
 
-    if ($gccversion) {
+    my $warns;
+    my $ccwarn = $conf->data->get('ccwarn');
 
-        # If using gcc, crank up its warnings as much as possible and make it
-        # behave  ansi-ish.  Here's an attempt at a list of nasty things we can
-        # use for a given version of gcc. The earliest documentation I
-        # currently have access to is for 2.95, so I don't know what version
-        # everything came in at. If it turns out that you're using 2.7.2 and
-        # -Wfoo isn't recognised there, move it up into the next version becone
-        # (2.8)
-
-        # Don't use -ansi -pedantic.  It makes it much harder to compile using
-        # the system headers, which may well be tuned to a non-strict
-        # environment -- especially since we are using perl5 compilation flags
-        # determined in a non-strict environment.  An example is Solaris 8.
-
-        my @opt_and_vers = (
-                  0 => ""
-                . " -W"
-                . " -Wall"
-                . " -Waggregate-return"
-                . " -Wbad-function-cast"
-                . " -Wcast-align"
-                . " -Wcast-qual"
-                . " -Wchar-subscripts "
-                . " -Wcomment"
-                . " -Wdisabled-optimization"
-                . " -Wformat-nonliteral"
-                . " -Wformat-security"
-                . " -Wformat-y2k"
-                . " -Wimplicit"
-                . " -Wimplicit-function-declaration"
-                . " -Wimplicit-int"
-                . " -Wimport"
-                . " -Winline"
-                . " -Wmain"
-                . " -Wmissing-braces"
-                . " -Wmissing-declarations"
-                . " -Wmissing-prototypes"
-                . " -Wnested-externs"
-                . " -Wno-unused"
-                . " -Wnonnull"
-                . " -Wpacked"
-                . " -Wparentheses"
-                . " -Wpointer-arith"
-                . " -Wreturn-type"
-                . " -Wsequence-point"
-                . " -Wshadow"
-                . " -Wsign-compare"
-                . " -Wstrict-aliasing"
-                . " -Wstrict-prototypes"
-                . " -Wswitch"
-                #. " -Wswitch-default"
-                #. " -Wswitch-enum"
-                . " -Wnested-externs"
-                . " -Wundef"
-                . " -Wunknown-pragmas"
-                . " -Wwrite-strings"
-                . ( $maint ? " -Wlarger-than-4096" : "" ),
-
-            # others; ones we might like marked with ?
-            # ? -Wundef for undefined idenfiers in #if
-            # ? -Wbad-function-cast
-            #   Warn whenever a function call is cast to a non-matching type
-            # ? -Wmissing-declarations
-            #   Warn if a global function is defined without a previous
-            #   declaration -Wmissing-noreturn
-            # ? -Wredundant-decls
-            #    Warn if anything is declared more than once in the same scope,
-            # ? -Wnested-externs
-            #    Warn if an `extern' declaration is encountered within an
-            #    function.  -Wlong-long
-            # Ha. this is the default! with -pedantic.
-            # -Wno-long-long for the nicest bit of C99
-            #
-            # -Wcast-align is now removed: it gives too many false positives
-            #    e.g. when accessing registers - this is all aligned
-
-            2.7  => "",
-            2.8  => "-Wsign-compare",
-            2.95 => "",
-
-            # 2.95 does align functions per default -malign-functions=4
-            #      where the argument is used as a power of 2
-            # 3.x  does not align functions per default, its turned on with
-            #      -O2 and -O3
-            #      -falign-functions=16 is the real alignment, no exponent
-            3.0 => ""
-                . " -falign-functions=16"
-                . " -Wdisabled-optimization"
-                . " -Wformat-nonliteral"
-                . " -Wformat-security"
-                . " -mno-accumulate-outgoing-args"
-                . " -Wno-shadow"
-                . " -Wpacked"
-                . "",
-
-            3.4 => ""
-                . " -Wbad-function-cast"
-                . " -Wdeclaration-after-statement"
-                . " -Wextra"
-                . " -Winit-self"
-                . " -Winvalid-pch"
-                . " -Wold-style-definition"
-                . " -Wstrict-aliasing=2"
-                . "",
-
-            # -Wsequence-point is part of -Wall
-            # -Wfloat-equal may not be what we want
-            # We shouldn't be using __packed__, but I doubt -Wpacked will harm
-            # us -Wpadded may prove interesting, or even noisy.
-            # -Wunreachable-code might be useful in a non debugging version
-            4.0 => ""
-                . " -fvisibility=hidden"
-                . " -Wmissing-field-initializers"
-                . "",
-
-            # Needed to prevent C++ compatibility issues
-            4.1 => ""
-                . " -Wc++-compat"
-                . "",
-        );
+    # If using gcc, crank up its warnings as much as possible and make it
+    # behave  ansi-ish.  Here's an attempt at a list of nasty things we can
+    # use for a given version of gcc. The earliest documentation I
+    # currently have access to is for 2.95, so I don't know what version
+    # everything came in at. If it turns out that you're using 2.7.2 and
+    # -Wfoo isn't recognised there, move it up into the next version becone
+    # (2.8)
+
+    # Don't use -ansi -pedantic.  It makes it much harder to compile using
+    # the system headers, which may well be tuned to a non-strict
+    # environment -- especially since we are using perl5 compilation flags
+    # determined in a non-strict environment.  An example is Solaris 8.
+
+    my @opt_and_vers = (
+              0 => ""
+            . " -W"
+            . " -Wall"
+            . " -Waggregate-return"
+            . " -Wbad-function-cast"
+            . " -Wcast-align"
+            . " -Wcast-qual"
+            . " -Wchar-subscripts "
+            . " -Wcomment"
+            . " -Wdisabled-optimization"
+            . " -Wformat-nonliteral"
+            . " -Wformat-security"
+            . " -Wformat-y2k"
+            . " -Wimplicit"
+            . " -Wimplicit-function-declaration"
+            . " -Wimplicit-int"
+            . " -Wimport"
+            . " -Winline"
+            . " -Wmain"
+            . " -Wmissing-braces"
+            . " -Wmissing-declarations"
+            . " -Wmissing-prototypes"
+            . " -Wnested-externs"
+            . " -Wno-unused"
+            . " -Wnonnull"
+            . " -Wpacked"
+            . " -Wparentheses"
+            . " -Wpointer-arith"
+            . " -Wreturn-type"
+            . " -Wsequence-point"
+            . " -Wshadow"
+            . " -Wsign-compare"
+            . " -Wstrict-aliasing"
+            . " -Wstrict-prototypes"
+            . " -Wswitch"
+            #. " -Wswitch-default"
+            #. " -Wswitch-enum"
+            . " -Wnested-externs"
+            . " -Wundef"
+            . " -Wunknown-pragmas"
+            . " -Wwrite-strings"
+            . (
+                $conf->options->get('maintainer')
+                ? " -Wlarger-than-4096"
+                : ""
+              ),
+
+        # others; ones we might like marked with ?
+        # ? -Wundef for undefined idenfiers in #if
+        # ? -Wbad-function-cast
+        #   Warn whenever a function call is cast to a non-matching type
+        # ? -Wmissing-declarations
+        #   Warn if a global function is defined without a previous
+        #   declaration -Wmissing-noreturn
+        # ? -Wredundant-decls
+        #    Warn if anything is declared more than once in the same scope,
+        # ? -Wnested-externs
+        #    Warn if an `extern' declaration is encountered within an
+        #    function.  -Wlong-long
+        # Ha. this is the default! with -pedantic.
+        # -Wno-long-long for the nicest bit of C99
+        #
+        # -Wcast-align is now removed: it gives too many false positives
+        #    e.g. when accessing registers - this is all aligned
+
+        2.7  => "",
+        2.8  => "-Wsign-compare",
+        2.95 => "",
+
+        # 2.95 does align functions per default -malign-functions=4
+        #      where the argument is used as a power of 2
+        # 3.x  does not align functions per default, its turned on with
+        #      -O2 and -O3
+        #      -falign-functions=16 is the real alignment, no exponent
+        3.0 => ""
+            . " -falign-functions=16"
+            . " -Wdisabled-optimization"
+            . " -Wformat-nonliteral"
+            . " -Wformat-security"
+            . " -mno-accumulate-outgoing-args"
+            . " -Wno-shadow"
+            . " -Wpacked"
+            . "",
+
+        3.4 => ""
+            . " -Wbad-function-cast"
+            . " -Wdeclaration-after-statement"
+            . " -Wextra"
+            . " -Winit-self"
+            . " -Winvalid-pch"
+            . " -Wold-style-definition"
+            . " -Wstrict-aliasing=2"
+            . "",
+
+        # -Wsequence-point is part of -Wall
+        # -Wfloat-equal may not be what we want
+        # We shouldn't be using __packed__, but I doubt -Wpacked will harm
+        # us -Wpadded may prove interesting, or even noisy.
+        # -Wunreachable-code might be useful in a non debugging version
+        4.0 => ""
+            . " -fvisibility=hidden"
+            . " -Wmissing-field-initializers"
+            . "",
+
+        # Needed to prevent C++ compatibility issues
+        4.1 => ""
+            . " -Wc++-compat"
+            . "",
+    );
 
-        my @cage_opt_and_vers = (
-                  0 => ""
-                . " -std=c89"
-                . " -Wall"
-                . " -Waggregate-return"
-                . " -Wextra"
-                . " -Wbad-function-cast"
-                . " -Wcast-align"
-                . " -Wcast-qual"
-                . " -Wchar-subscripts "
-                . " -Wcomment"
-                . " -Wconversion"
-                . " -Wdeclaration-after-statement"
-                . " -Wdisabled-optimization"
-                . " -Wformat"
-                . " -Wformat=2"
-                . " -Wformat-nonliteral"
-                . " -Wformat-security"
-                . " -Wformat-y2k"
-                . " -Wimplicit"
-                . " -Wimplicit-function-declaration"
-                . " -Wimplicit-int"
-                . " -Wimport"
-                . " -Winit-self"
-                . " -Winline"
-                . " -Winvalid-pch"
-                . " -Wlarger-than-4096"
-                . " -Wlong-long"
-                . " -Wmain"
-                . " -Wmissing-braces"
-                . " -Wmissing-declarations"
-                . " -Wmissing-format-attribute"
-                . " -Wmissing-noreturn"
-                . " -Wmissing-prototypes"
-                . " -Wnested-externs"
-                . " -Wnonnull"
-                . " -Wold-style-definition"
-                . " -Wpacked"
-                . " -Wpadded"
-                . " -Wparentheses"
-                . " -Wpointer-arith"
-                . " -Wredundant-decls"
-                . " -Wreturn-type"
-                . " -Wsequence-point"
-                . " -Wshadow"
-                . " -Wsign-compare"
-                . " -Wstrict-aliasing"
-                . " -Wstrict-aliasing=2"
-                . " -Wstrict-prototypes"
-                . " -Wswitch"
-                . " -Wswitch-default"
-                . " -Wswitch-enum"
-                . " -Wsystem-headers"
-                . " -Wtrigraphs"
-                . " -Wundef"
-                . " -Wunknown-pragmas"
-                . " -Wunreachable-code"
-                . " -Wunused-function"
-                . " -Wunused-label"
-                . " -Wunused-parameter"
-                . " -Wunused-value"
-                . " -Wunused-variable"
-                . " -Wwrite-strings"
-                #. "-fsyntax-only "
-                #. "-pedantic -pedantic-errors "
-                #. " -w "
-                #. " -Werror "
-                . " -Wno-deprecated-declarations"
-                . " -Wno-div-by-zero"
-                . " -Wno-endif-labels"
-                . " -Werror-implicit-function-declaration"
-                #. " -Wfloat-equal"
-                . " -Wno-format-extra-args"
-                . " -Wno-import"
-                . " -Wno-multichar"
-                #. " -Wuninitialized "
-                #     requires -O
-                #."-Wmost (APPLE ONLY)"
-                #C-only Warning Options
-                #. " -Wtraditional "
-                . "",
-
-            # others; ones we might like marked with ?
-            # ? -Wundef for undefined idenfiers in #if
-            # ? -Wbad-function-cast
-            #   Warn whenever a function call is cast to a non-matching type
-            # ? -Wmissing-declarations
-            #   Warn if a global function is defined without a previous
-            #   declaration -Wmissing-noreturn
-            # ? -Wredundant-decls
-            #    Warn if anything is declared more than once in the same scope,
-            # ? -Wnested-externs
-            #    Warn if an `extern' declaration is encountered within an
-            #    function.  -Wlong-long
-            # Ha. this is the default! with -pedantic.
-            # -Wno-long-long for the nicest bit of C99
-            #
-            # -Wcast-align is now removed: it gives too many false positives
-            #    e.g. when accessing registers - this is all aligned
-
-            2.7 => "",
-            2.8 => "",
-
-            #2.8  => "-Wsign-compare",
-            2.95 => "",
-
-            # 2.95 does align functions per default -malign-functions=4
-            #      where the argument is used as a power of 2
-            # 3.x  does not align functions per default, its turned on with
-            #      -O2 and -O3
-            #      -falign-functions=16 is the real alignment, no exponent
-            3.0 => "",
-
-            #3.0 => "-Wformat-nonliteral -Wformat-security -Wpacked "
-            #    . "-Wdisabled-optimization -mno-accumulate-outgoing-args "
-            #    . "-Wno-shadow -falign-functions=16 ",
-            4.0 => ""
-                #. " -Wfatal-errors"
-                . " -Wmissing-field-initializers"
-                . " -Wmissing-include-dirs"
-                . " -Wvariadic-macros"
-                #. " -Wno-discard-qual"
-                . " -Wno-pointer-sign"
-                . "",
-            4.1 => ""
-                . " -Wc++-compat"
-                . "",
-            4.2 => ""
-                . " -Wlogical-op"
-                . "",
-
-            # -Wsequence-point is part of -Wall
-            # -Wfloat-equal may not be what we want
-            # We shouldn't be using __packed__, but I doubt -Wpacked will harm
-            # us -Wpadded may prove interesting, or even noisy.
-            # -Wunreachable-code might be useful in a non debugging version
-        );
+    my @cage_opt_and_vers = (
+              0 => ""
+            . " -std=c89"
+            . " -Wall"
+            . " -Waggregate-return"
+            . " -Wextra"
+            . " -Wbad-function-cast"
+            . " -Wcast-align"
+            . " -Wcast-qual"
+            . " -Wchar-subscripts "
+            . " -Wcomment"
+            . " -Wconversion"
+            . " -Wdeclaration-after-statement"
+            . " -Wdisabled-optimization"
+            . " -Wformat"
+            . " -Wformat=2"
+            . " -Wformat-nonliteral"
+            . " -Wformat-security"
+            . " -Wformat-y2k"
+            . " -Wimplicit"
+            . " -Wimplicit-function-declaration"
+            . " -Wimplicit-int"
+            . " -Wimport"
+            . " -Winit-self"
+            . " -Winline"
+            . " -Winvalid-pch"
+            . " -Wlarger-than-4096"
+            . " -Wlong-long"
+            . " -Wmain"
+            . " -Wmissing-braces"
+            . " -Wmissing-declarations"
+            . " -Wmissing-format-attribute"
+            . " -Wmissing-noreturn"
+            . " -Wmissing-prototypes"
+            . " -Wnested-externs"
+            . " -Wnonnull"
+            . " -Wold-style-definition"
+            . " -Wpacked"
+            . " -Wpadded"
+            . " -Wparentheses"
+            . " -Wpointer-arith"
+            . " -Wredundant-decls"
+            . " -Wreturn-type"
+            . " -Wsequence-point"
+            . " -Wshadow"
+            . " -Wsign-compare"
+            . " -Wstrict-aliasing"
+            . " -Wstrict-aliasing=2"
+            . " -Wstrict-prototypes"
+            . " -Wswitch"
+            . " -Wswitch-default"
+            . " -Wswitch-enum"
+            . " -Wsystem-headers"
+            . " -Wtrigraphs"
+            . " -Wundef"
+            . " -Wunknown-pragmas"
+            . " -Wunreachable-code"
+            . " -Wunused-function"
+            . " -Wunused-label"
+            . " -Wunused-parameter"
+            . " -Wunused-value"
+            . " -Wunused-variable"
+            . " -Wwrite-strings"
+            #. "-fsyntax-only "
+            #. "-pedantic -pedantic-errors "
+            #. " -w "
+            #. " -Werror "
+            . " -Wno-deprecated-declarations"
+            . " -Wno-div-by-zero"
+            . " -Wno-endif-labels"
+            . " -Werror-implicit-function-declaration"
+            #. " -Wfloat-equal"
+            . " -Wno-format-extra-args"
+            . " -Wno-import"
+            . " -Wno-multichar"
+            #. " -Wuninitialized "
+            #     requires -O
+            #."-Wmost (APPLE ONLY)"
+            #C-only Warning Options
+            #. " -Wtraditional "
+            . "",
+
+        # others; ones we might like marked with ?
+        # ? -Wundef for undefined idenfiers in #if
+        # ? -Wbad-function-cast
+        #   Warn whenever a function call is cast to a non-matching type
+        # ? -Wmissing-declarations
+        #   Warn if a global function is defined without a previous
+        #   declaration -Wmissing-noreturn
+        # ? -Wredundant-decls
+        #    Warn if anything is declared more than once in the same scope,
+        # ? -Wnested-externs
+        #    Warn if an `extern' declaration is encountered within an
+        #    function.  -Wlong-long
+        # Ha. this is the default! with -pedantic.
+        # -Wno-long-long for the nicest bit of C99
+        #
+        # -Wcast-align is now removed: it gives too many false positives
+        #    e.g. when accessing registers - this is all aligned
+
+        2.7 => "",
+        2.8 => "",
+
+        #2.8  => "-Wsign-compare",
+        2.95 => "",
+
+        # 2.95 does align functions per default -malign-functions=4
+        #      where the argument is used as a power of 2
+        # 3.x  does not align functions per default, its turned on with
+        #      -O2 and -O3
+        #      -falign-functions=16 is the real alignment, no exponent
+        3.0 => "",
+
+        #3.0 => "-Wformat-nonliteral -Wformat-security -Wpacked "
+        #    . "-Wdisabled-optimization -mno-accumulate-outgoing-args "
+        #    . "-Wno-shadow -falign-functions=16 ",
+        4.0 => ""
+            #. " -Wfatal-errors"
+            . " -Wmissing-field-initializers"
+            . " -Wmissing-include-dirs"
+            . " -Wvariadic-macros"
+            #. " -Wno-discard-qual"
+            . " -Wno-pointer-sign"
+            . "",
+        4.1 => ""
+            . " -Wc++-compat"
+            . "",
+        4.2 => ""
+            . " -Wlogical-op"
+            . "",
+
+        # -Wsequence-point is part of -Wall
+        # -Wfloat-equal may not be what we want
+        # We shouldn't be using __packed__, but I doubt -Wpacked will harm
+        # us -Wpadded may prove interesting, or even noisy.
+        # -Wunreachable-code might be useful in a non debugging version
+    );
 
-        $warns = "";
-        my @warning_options = ( [EMAIL PROTECTED] );
-        push @warning_options, [EMAIL PROTECTED]
-            if $conf->options->get('cage');
-
-        foreach my $curr_opt_and_vers (@warning_options) {
-            while ( my ( $vers, $opt ) = splice @$curr_opt_and_vers, 0, 2 ) {
-                last if $vers > $gccversion;
-                next unless $opt;    # Ignore blank lines
-
-                if ( $opt =~ /-mno-accumulate-outgoing-args/ ) {
-                    use Config;
-                    if ( $Config{archname} !~ /86/ ) {
-                        $opt =~ s/-mno-accumulate-outgoing-args//;
-                    }
+    $warns = "";
+    my @warning_options = ( [EMAIL PROTECTED] );
+    push @warning_options, [EMAIL PROTECTED]
+        if $conf->options->get('cage');
+
+    foreach my $curr_opt_and_vers (@warning_options) {
+        while ( my ( $vers, $opt ) = splice @$curr_opt_and_vers, 0, 2 ) {
+            last if $vers > $gccversion;
+            next unless $opt;    # Ignore blank lines
+
+            if ( $opt =~ /-mno-accumulate-outgoing-args/ ) {
+                use Config;
+                if ( $Config{archname} !~ /86/ ) {
+                    $opt =~ s/-mno-accumulate-outgoing-args//;
                 }
-                $warns .= " $opt";
             }
+            $warns .= " $opt";
         }
+    }
 
-        # if the user overwrites the warnings remove it from $warns
-        if ($ccwarn) {
-            my @warns = split ' ', $warns;
-            foreach my $w ( split ' ', $ccwarn ) {
-                $w =~ s/^-W(?:no-)?(.*)$/$1/;
-                @warns = grep !/^-W(?:no-)?$w$/, @warns;
-            }
-            $warns = join ' ', @warns;
+    # if the user overwrites the warnings remove it from $warns
+    if ($ccwarn) {
+        my @warns = split ' ', $warns;
+        foreach my $w ( split ' ', $ccwarn ) {
+            $w =~ s/^-W(?:no-)?(.*)$/$1/;
+            @warns = grep !/^-W(?:no-)?$w$/, @warns;
         }
+        $warns = join ' ', @warns;
     }
 
     $conf->data->set( sym_export => '__attribute__ ((visibility("default")))' )
         if $gccversion >= 4.0;
 
-    if ( defined $conf->options->get('miniparrot') && $gccversion ) {
-
+    if ( defined $conf->options->get('miniparrot') ) {
         # make the compiler act as ANSIish as possible, and avoid enabling
         # support for GCC-specific features.
-
         $conf->data->set(
             ccwarn     => "-ansi -pedantic",
             gccversion => undef
         );
-
-        return 1;
     }
-
-    $conf->data->set(
-        ccwarn              => "$warns $ccwarn",
-        gccversion          => $gccversion,
-        HAS_aligned_funcptr => 1
-    );
-
-    $conf->data->set( HAS_aligned_funcptr => 0 )
-        if $^O eq 'hpux';
-
+    else {
+        $conf->data->set(
+            ccwarn              => "$warns $ccwarn",
+            gccversion          => $gccversion,
+            HAS_aligned_funcptr => 1
+        );
+        $conf->data->set( HAS_aligned_funcptr => 0 )
+            if $^O eq 'hpux';
+    }
     return 1;
 }
 

Modified: trunk/t/configure/114-auto_attributes.t
==============================================================================
--- trunk/t/configure/114-auto_attributes.t     (original)
+++ trunk/t/configure/114-auto_attributes.t     Wed Oct 31 16:00:52 2007
@@ -14,10 +14,9 @@
 use Parrot::Configure::Options qw( process_options );
 use Parrot::Configure::Test qw( test_step_thru_runstep);
 
-my $pkg = q{auto::attributes};
 
 my $args = process_options( {
-    argv            => [ qq{--verbose-step=$pkg} ],
+    argv            => [ qq{--verbose} ],
     mode            => q{configure},
 } );
 
@@ -26,6 +25,7 @@
 test_step_thru_runstep($conf, q{init::defaults}, $args);
 
 my ($task, $step_name, @step_params, $step, $ret);
+my $pkg = q{auto::attributes};
 
 $conf->add_steps($pkg);
 $conf->options->set(%{$args});

Reply via email to