<gbacon@cs.uah.edu>)
p4raw-id: //depot/perl@4947
my $catmask ;
my $fatal = 0 ;
foreach my $word (@_) {
- if ($word eq 'FATAL')
- { $fatal = 1 }
- elsif ($catmask = $Bits{$word}) {
- $mask |= $catmask ;
- $mask |= $DeadBits{$word} if $fatal ;
+ if ($word eq 'FATAL') {
+ $fatal = 1;
+ }
+ else {
+ if ($catmask = $Bits{$word}) {
+ $mask |= $catmask ;
+ $mask |= $DeadBits{$word} if $fatal ;
+ }
}
- else
- { croak "unknown warning category '$word'" }
}
return $mask ;
__END__
-# check illegal category is caught
-use warnings 'blah' ;
+# ignore unknown warning categories
+use warnings 'this-should-never-be-a-warning-category' ;
EXPECT
-unknown warning category 'blah' at - line 3
-BEGIN failed--compilation aborted at - line 3.
########
# Check compile time scope of pragma
my $catmask ;
my $fatal = 0 ;
foreach my $word (@_) {
- if ($word eq 'FATAL')
- { $fatal = 1 }
- elsif ($catmask = $Bits{$word}) {
- $mask |= $catmask ;
- $mask |= $DeadBits{$word} if $fatal ;
+ if ($word eq 'FATAL') {
+ $fatal = 1;
+ }
+ else {
+ if ($catmask = $Bits{$word}) {
+ $mask |= $catmask ;
+ $mask |= $DeadBits{$word} if $fatal ;
+ }
}
- else
- { croak "unknown warning category '$word'" }
}
return $mask ;