'misc' => [ 5.008, DEFAULT_OFF],
'regexp' => [ 5.008, DEFAULT_OFF],
'glob' => [ 5.008, DEFAULT_OFF],
- 'y2k' => [ 5.008, DEFAULT_OFF],
'untie' => [ 5.008, DEFAULT_OFF],
'substr' => [ 5.008, DEFAULT_OFF],
'taint' => [ 5.008, DEFAULT_OFF],
unlink "warnings.h";
unlink "lib/warnings.pm";
open(WARN, ">warnings.h") || die "Can't create warnings.h: $!\n";
+binmode WARN;
open(PM, ">lib/warnings.pm") || die "Can't create lib/warnings.pm: $!\n";
+binmode PM;
print WARN <<'EOM' ;
-/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+/* -*- buffer-read-only: t -*-
+ !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
This file is built by warnings.pl
Any changes made here will be lost!
*/
#define isLEXWARN_on (PL_curcop->cop_warnings != pWARN_STD)
#define isLEXWARN_off (PL_curcop->cop_warnings == pWARN_STD)
#define isWARN_ONCE (PL_dowarn & (G_WARN_ON|G_WARN_ONCE))
-#define isWARN_on(c,x) (IsSet(SvPVX(c), 2*(x)))
-#define isWARNf_on(c,x) (IsSet(SvPVX(c), 2*(x)+1))
+#define isWARN_on(c,x) (IsSet(SvPVX_const(c), 2*(x)))
+#define isWARNf_on(c,x) (IsSet(SvPVX_const(c), 2*(x)+1))
#define ckWARN(x) \
( (isLEXWARN_on && PL_curcop->cop_warnings != pWARN_NONE && \
isWARNf_on(PL_curcop->cop_warnings, unpackWARN4(x))))
/* end of file warnings.h */
-
+/* ex: set ro: */
EOM
close WARN ;
#$list{'all'} = [ $offset .. 8 * ($warn_size/2) - 1 ] ;
$last_ver = 0;
-print PM "our %Offsets : unique = (\n" ;
+print PM "our %Offsets = (\n" ;
foreach my $k (sort { $a <=> $b } keys %ValueToName) {
my ($name, $version) = @{ $ValueToName{$k} };
$name = lc $name;
print PM " );\n\n" ;
-print PM "our %Bits : unique = (\n" ;
+print PM "our %Bits = (\n" ;
foreach $k (sort keys %list) {
my $v = $list{$k} ;
print PM " );\n\n" ;
-print PM "our %DeadBits : unique = (\n" ;
+print PM "our %DeadBits = (\n" ;
foreach $k (sort keys %list) {
my $v = $list{$k} ;
print PM $_ ;
}
+print PM "# ex: set ro:\n";
close PM ;
__END__
-
+# -*- buffer-read-only: t -*-
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
# This file was created by warnings.pl
# Any changes made here will be lost.
package warnings;
-our $VERSION = '1.03';
+our $VERSION = '1.04';
=head1 NAME
=cut
-use Carp ();
-
KEYWORDS
$All = "" ; vec($All, $Offsets{'all'}, 2) = 3 ;
sub Croaker
{
+ require Carp;
delete $Carp::CarpInternal{'warnings'};
Carp::croak(@_);
}
${^WARNING_BITS} = $mask ;
}
+my %builtin_type; @builtin_type{qw(SCALAR ARRAY HASH CODE REF GLOB LVALUE Regexp)} = ();
+
sub __chk
{
my $category ;
if (@_) {
# check the category supplied.
$category = shift ;
- if (ref $category) {
- Croaker ("not an object")
- if $category !~ /^([^=]+)=/ ;
- $category = $1 ;
+ if (my $type = ref $category) {
+ Croaker("not an object")
+ if exists $builtin_type{$type};
+ $category = $type;
$isobj = 1 ;
}
$offset = $Offsets{$category};
my $message = pop ;
my ($callers_bitmask, $offset, $i) = __chk(@_) ;
+ require Carp;
Carp::croak($message)
if vec($callers_bitmask, $offset+1, 1) ||
vec($callers_bitmask, $Offsets{'all'}+1, 1) ;
(vec($callers_bitmask, $offset, 1) ||
vec($callers_bitmask, $Offsets{'all'}, 1)) ;
+ require Carp;
Carp::croak($message)
if vec($callers_bitmask, $offset+1, 1) ||
vec($callers_bitmask, $Offsets{'all'}+1, 1) ;