From: Gurusamy Sarathy Date: Tue, 14 Mar 2000 22:44:27 +0000 (+0000) Subject: more warnings tidy-ups (from Paul Marquess) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8cd7955893792dd3ae9bfaf61ca10fa3182273ac;p=p5sagit%2Fp5-mst-13.2.git more warnings tidy-ups (from Paul Marquess) p4raw-id: //depot/perl@5747 --- diff --git a/pod/perldelta.pod b/pod/perldelta.pod index b8eaa47..361dcc4 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -2443,6 +2443,25 @@ Remember that "my", "our", and "local" bind tighter than comma. (W) You are concatenating the number 19 with another number, which could be a potential Year 2000 problem. +=item pragma "attrs" is deprecated, use "sub NAME : ATTRS" instead + +(W) You have written somehing like this: + + sub doit + { + use attrs qw(locked); + } + +You should use the new declaration syntax instead. + + sub doit : locked + { + ... + +The C pragma is now obsolete, and is only provided for +backward-compatibility. See L. + + =item Premature end of script headers See Server error. diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 8701714..d57e7e5 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2529,6 +2529,24 @@ Perl guesses a reasonable buffer size, but puts a sentinel byte at the end of the buffer just in case. This sentinel byte got clobbered, and Perl assumes that memory is now corrupted. See L. +=item pragma "attrs" is deprecated, use "sub NAME : ATTRS" instead + +(W deprecated) You have written somehing like this: + + sub doit + { + use attrs qw(locked); + } + +You should use the new declaration syntax instead. + + sub doit : locked + { + ... + +The C pragma is now obsolete, and is only provided for +backward-compatibility. See L. + =item Precedence problem: open %s should be open(%s) (S precedence) The old irregular construct diff --git a/pod/perlfaq4.pod b/pod/perlfaq4.pod index b8ccfba..e997a8f 100644 --- a/pod/perlfaq4.pod +++ b/pod/perlfaq4.pod @@ -446,9 +446,7 @@ parser. If you are serious about writing a parser, there are a number of modules or oddities that will make your life a lot easier. There are the CPAN modules Parse::RecDescent, Parse::Yapp, and Text::Balanced; -the byacc program; and Mark-Jason -Dominus's excellent I tool at http://www.plover.com/%7Emjd/perl/py/ -. +and the byacc program. One simple destructive, inside-out approach that you might try is to pull out the smallest nesting parts one at a time: diff --git a/t/lib/attrs.t b/t/lib/attrs.t index d8afbf6..eb8c8c4 100644 --- a/t/lib/attrs.t +++ b/t/lib/attrs.t @@ -117,6 +117,19 @@ unless ($@ && $@ =~ m/Invalid separator character '[+]' in attribute list at/) { print "ok ",++$test,"\n"; BEGIN {++$ntests} +{ + my $w = "" ; + local $SIG{__WARN__} = sub {$w = @_[0]} ; + eval 'sub w1 ($) { use warnings "deprecated"; use attrs "locked"; $_[0]++ }'; + (print "not "), $failed=1 if $@; + print "ok ",++$test,"\n"; + BEGIN {++$ntests} + (print "not "), $failed=1 + if $w !~ /^pragma "attrs" is deprecated, use "sub NAME : ATTRS" instead at/; + print "ok ",++$test,"\n"; + BEGIN {++$ntests} +} + # Other tests should be added above this line diff --git a/utils/h2xs.PL b/utils/h2xs.PL index 50b15d1..033ad02 100644 --- a/utils/h2xs.PL +++ b/utils/h2xs.PL @@ -646,6 +646,7 @@ package $module; require 5.005_62; use strict; +use warnings; END unless( $opt_X || $opt_c || $opt_A ){