automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: -Werror + perl warning => exit != 0


From: Alexandre Duret-Lutz
Subject: FYI: -Werror + perl warning => exit != 0
Date: Fri, 08 Nov 2002 00:02:45 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/20.7 (i386-debian-linux-gnu)

I'm checking this in (HEAD & branch-1-7).  
This causes the test suite to halt on any Perl warning.

2002-11-07  Alexandre Duret-Lutz  <address@hidden>

        * automake.in (switch_warning): Subject Perl warnings to -Werror.
 
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1382
diff -u -r1.1382 automake.in
--- automake.in 6 Nov 2002 10:47:30 -0000       1.1382
+++ automake.in 7 Nov 2002 23:00:05 -0000
@@ -1431,11 +1431,15 @@
     }
   elsif ($cat eq 'none')
     {
-      setup_channel_type 'warning', silent => 1 - $has_no;
+      setup_channel_type 'warning', silent => ! $has_no;
     }
   elsif ($cat eq 'error')
     {
-      $warnings_are_errors = 1 - $has_no;
+      $warnings_are_errors = ! $has_no;
+      # Set exit code if Perl warns about something
+      # (like uninitialized variables).
+      $SIG{"__WARN__"} =
+       $has_no ? 'DEFAULT' : sub { print STDERR @_; $exit_code = 1; };
     }
   elsif (channel_type ($cat) eq 'warning')
     {

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]