This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate mainline
authorNick Ing-Simmons <nik@tiuk.ti.com>
Fri, 21 Jun 2002 13:30:07 +0000 (13:30 +0000)
committerNick Ing-Simmons <nik@tiuk.ti.com>
Fri, 21 Jun 2002 13:30:07 +0000 (13:30 +0000)
p4raw-id: //depot/perlio@17342

28 files changed:
Configure
NetWare/config_H.wc
Porting/config.sh
Porting/config_H
configure.com
ext/POSIX/POSIX.pod
hints/amigaos.sh
lib/Getopt/Long.pm
lib/Getopt/Long/CHANGES
lib/warnings.pm
numeric.c
perl.h
pod/perldelta.pod
pod/perliol.pod
pod/perllexwarn.pod
pod/perlmodlib.pod
pod/perlrun.pod
pod/perltoc.pod
t/lib/warnings/7fatal
uconfig.h
vos/config.alpha.h
vos/config.ga.h
warnings.pl
win32/config_H.bc
win32/config_H.gc
win32/config_H.vc
win32/config_H.vc64
wince/config_H.ce

index 4f522cf..128f003 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -20,7 +20,7 @@
 
 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
 #
-# Generated on Tue Jun 18 06:36:23 EET DST 2002 [metaconfig 3.0 PL70]
+# Generated on Fri Jun 21 16:37:53 EET DST 2002 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >c1$$ <<EOF
index 33fbbb1..be5a841 100644 (file)
 
 /* HAS_GNULIBC:
  *     This symbol, if defined, indicates to the C program that 
- *     the GNU C library is being used.
+ *     the GNU C library is being used.  A better check is to use
+ *     the __GLIBC__ and __GLIBC_MINOR__ symbols supplied with glibc.
  */
 /*#define HAS_GNULIBC          /**/
 #if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)
index 6d75708..b74cbc2 100644 (file)
@@ -8,7 +8,7 @@
 
 # Package name      : perl5
 # Source directory  : .
-# Configuration time: Fri Jun 14 18:00:35 EET DST 2002
+# Configuration time: Fri Jun 21 16:39:44 EET DST 2002
 # Configured by     : jhi
 # Target system     : osf1 alpha.hut.fi v4.0 878 alpha 
 
@@ -63,7 +63,7 @@ ccsymbols='__alpha=1 __LANGUAGE_C__=1 __osf__=1 __unix__=1 _LONGLONG=1 _SYSTYPE_
 ccversion='V5.6-082'
 cf_by='jhi'
 cf_email='yourname@yourhost.yourplace.com'
-cf_time='Fri Jun 14 18:00:35 EET DST 2002'
+cf_time='Fri Jun 21 16:39:44 EET DST 2002'
 charsize='1'
 chgrp=''
 chmod='chmod'
@@ -770,7 +770,7 @@ patchlevel='8'
 path_sep=':'
 perl5='perl'
 perl=''
-perl_patchlevel='17237'
+perl_patchlevel='17302'
 perladmin='yourname@yourhost.yourplace.com'
 perllibs='-lm -lutil'
 perlpath='/opt/perl/bin/perl'
@@ -954,7 +954,7 @@ vendorlibexp=''
 vendorprefix=''
 vendorprefixexp=''
 version='5.8.0'
-version_patchlevel_string='version 8 subversion 0 patch 17237'
+version_patchlevel_string='version 8 subversion 0 patch 17302'
 versiononly='undef'
 vi=''
 voidflags='15'
@@ -983,7 +983,7 @@ PERL_SUBVERSION=0
 PERL_API_REVISION=5
 PERL_API_VERSION=8
 PERL_API_SUBVERSION=0
-PERL_PATCHLEVEL=17237
+PERL_PATCHLEVEL=17302
 PERL_CONFIG_SH=true
 # Variables propagated from previous config.sh file.
 pp_sys_cflags='ccflags="$ccflags -DNO_EFF_ONLY_OK"'
index afc2bb5..4e9e45a 100644 (file)
@@ -17,7 +17,7 @@
 /*
  * Package name      : perl5
  * Source directory  : .
- * Configuration time: Fri Jun 14 18:00:35 EET DST 2002
+ * Configuration time: Fri Jun 21 16:39:44 EET DST 2002
  * Configured by     : jhi
  * Target system     : osf1 alpha.hut.fi v4.0 878 alpha 
  */
index 880cdf0..a4bfbf2 100644 (file)
@@ -2296,38 +2296,54 @@ $! Ask about threads, if appropriate
 $ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
 $ THEN
 $   echo ""
-$   echo "This version of Perl can be built with threads. While really nifty,"
-$   echo "they are a beta feature, and there is a speed penalty for perl"
-$   echo "programs if you build with threads *even if you do not use them*."
+$   echo "Perl can be built to take advantage of threads on some systems."
+$   echo "To do so, configure.com can be run with -""Dusethreads""."
+$   echo ""
+$   echo "Note that Perl built with threading support runs slightly slower"
+$   echo "and uses more memory than plain Perl. The current implementation"
+$   echo "is believed to be stable, but it is fairly new, and so should be"
+$   echo "treated with caution."
+$   echo ""
 $   bool_dflt = "n"
 $   if f$type(usethreads) .nes. "" 
 $   then 
 $       if usethreads .or. usethreads .eqs. "define" then bool_dflt="y"
 $   endif
-$   rp = "Build with threads? [''bool_dflt'] "
+$!  Catch cases where user specified ithreads or 5005threads but
+$!  forgot -Dusethreads 
+$   if f$type(useithreads) .nes. ""
+$   then
+$         if useithreads .or. useithreads .eqs. "define" then bool_dflt="y"
+$   endif
+$   if f$type(use5005threads) .nes. ""
+$   then
+$         if use5005threads .or. use5005threads .eqs. "define" then bool_dflt="y"
+$   endif
+$   echo "If this doesn't make any sense to you, just accept the default '" + bool_dflt + "'."
+$   rp = "Build a threading Perl? [''bool_dflt'] "
 $   GOSUB myread
 $   if ans
 $   THEN
 $     use_threads="T"
-$     ! Shall we do the 5.005-stype threads, or IThreads?
-$     echo "As of 5.5.640, Perl has two different internal threading"
-$     echo "implementations, the 5.005 version (5005threads) and an"
-$     echo "interpreter-based version (ithreads) that has one"
-$     echo "interpreter per thread.  Both are very experimental.  This"
-$     echo "arrangement exists to help developers work out which one"
-$     echo "is better."
-$     echo ""
-$     echo "If you are a casual user, you probably do not want"
-$     echo "interpreter-threads at this time.  There doesn't yet exist"
-$     echo "a way to create threads from within Perl in this model,"
-$     echo "i.e., ""use Thread;"" will NOT work."
+$     ! Shall we do the 5.005-type threads, or IThreads?
+$     echo "Since release 5.6, Perl has had two different threading implementations,"
+$     echo "the newer interpreter-based version (ithreads) with one interpreter per"
+$     echo "thread, and the older 5.005 version (5005threads)."
+$     echo "The 5005threads version is effectively unmaintained and will probably be"
+$     echo "removed in Perl 5.10, so there should be no need to build a Perl using it"
+$     echo "unless needed for backwards compatibility with some existing 5.005threads"
+$     echo "code."
 $     echo ""
-$     bool_dflt = "n"
+$     bool_dflt = "y"
 $     if f$type(useithreads) .nes. ""
 $     then
-$         if useithreads .eqs. "define" then bool_dflt="y"
+$         if .not. useithreads .or. useithreads .eqs. "undef" then bool_dflt="n"
+$     endif
+$     if f$type(use5005threads) .nes. ""
+$     then
+$         if use5005threads .or. use5005threads .eqs. "define" then bool_dflt="n"
 $     endif
-$     rp = "Build with Interpreter threads? [''bool_dflt'] "
+$     rp = "Use the newer intepreter-based ithreads? [''bool_dflt'] "
 $     GOSUB myread
 $     use_ithreads=ans
 $     if use_ithreads 
@@ -3214,6 +3230,7 @@ $! Check for long double size
 $!
 $ OS
 $ WS "#if defined(__DECC) || defined(__DECCXX)"
+$ WS "#pragma message disable ALL"  ! VAX compilers may have distracting informationals
 $ WS "#include <stdlib.h>"
 $ WS "#endif"
 $ WS "#include <stdio.h>"
index 7b18fe5..286df40 100644 (file)
@@ -385,7 +385,7 @@ integer value less than or equal to the numerical argument.
 
 This is identical to the C function C<fmod()>.
 
-       $r = modf($x, $y);
+       $r = fmod($x, $y);
 
 It returns the remainder C<$r = $x - $n*$y>, where C<$n = trunc($x/$y)>.
 The C<$r> has the same sign as C<$x> and magnitude (absolute value)
index 52ba0bd..c5ba6ff 100644 (file)
@@ -7,6 +7,7 @@ archname='m68k-amigaos'
 cc='gcc'
 firstmakefile='GNUmakefile'
 usenm='true'
+d_fork='undef' # available but ENOSYS
 
 usemymalloc='n'
 useperlio='true'
index 2c3247e..7e1663d 100644 (file)
@@ -2,12 +2,12 @@
 
 package Getopt::Long;
 
-# RCS Status      : $Id: GetoptLong.pm,v 2.57 2002-05-03 17:03:38+02 jv Exp $
+# RCS Status      : $Id: GetoptLong.pm,v 2.58 2002-06-20 09:32:09+02 jv Exp $
 # Author          : Johan Vromans
 # Created On      : Tue Sep 11 15:00:12 1990
 # Last Modified By: Johan Vromans
-# Last Modified On: Fri May  3 17:01:26 2002
-# Update Count    : 1080
+# Last Modified On: Thu Jun 20 07:48:05 2002
+# Update Count    : 1083
 # Status          : Released
 
 ################ Copyright ################
@@ -35,10 +35,10 @@ use 5.004;
 use strict;
 
 use vars qw($VERSION);
-$VERSION        =  2.31;
+$VERSION        =  2.32;
 # For testing versions only.
 use vars qw($VERSION_STRING);
-$VERSION_STRING = "2.31";
+$VERSION_STRING = "2.32";
 
 use Exporter;
 
@@ -132,30 +132,9 @@ ConfigDefaults();
 
 package Getopt::Long::Parser;
 
-# Make Getopt::Long thread-safe for ithreads.
-BEGIN {
-    use Config;
-    if( $] >= 5.008 && $Config{useithreads} ) {
-        require threads;
-        require threads::shared;
-        threads::shared->import;
-        share(\$Getopt::Long::error);
-    }
-    else {
-        *lock = sub { 0 };
-    }
-}
-
-
-# NOTE: The object oriented routines use $error for thread locking.
-my $_lock = sub {
-    lock ($Getopt::Long::error) if $] >= 5.005
-};
-
 # Store a copy of the default configuration. Since ConfigDefaults has
 # just been called, what we get from Configure is the default.
 my $default_config = do {
-    &$_lock;
     Getopt::Long::Configure ()
 };
 
@@ -171,7 +150,6 @@ sub new {
 
     # Process config attributes.
     if ( defined $atts{config} ) {
-       &$_lock;
        my $save = Getopt::Long::Configure ($default_config, @{$atts{config}});
        $self->{settings} = Getopt::Long::Configure ($save);
        delete ($atts{config});
@@ -192,8 +170,6 @@ sub new {
 sub configure {
     my ($self) = shift;
 
-    &$_lock;
-
     # Restore settings, merge new settings in.
     my $save = Getopt::Long::Configure ($self->{settings}, @_);
 
@@ -204,8 +180,6 @@ sub configure {
 sub getoptions {
     my ($self) = shift;
 
-    &$_lock;
-
     # Restore config settings.
     my $save = Getopt::Long::Configure ($self->{settings});
 
@@ -275,7 +249,7 @@ sub GetOptions {
     $error = '';
 
     print STDERR ("GetOpt::Long $Getopt::Long::VERSION (",
-                 '$Revision: 2.57 $', ") ",
+                 '$Revision: 2.58 $', ") ",
                  "called from package \"$pkg\".",
                  "\n  ",
                  "ARGV: (@ARGV)",
@@ -924,7 +898,8 @@ sub FindOption ($$$$) {
     # Get key if this is a "name=value" pair for a hash option.
     my $key;
     if ($ctl->[CTL_DEST] == CTL_DEST_HASH && defined $arg) {
-       ($key, $arg) = ($arg =~ /^([^=]*)=(.*)$/s) ? ($1, $2) : ($arg, 1);
+       ($key, $arg) = ($arg =~ /^([^=]*)=(.*)$/s) ? ($1, $2)
+         : ($arg, defined($ctl->[CTL_DEFAULT]) ? $ctl->[CTL_DEFAULT] : 1);
     }
 
     #### Check if the argument is valid for this option ####
@@ -1538,9 +1513,11 @@ Configuration options can be passed to the constructor:
     $p = new Getopt::Long::Parser
              config => [...configuration options...];
 
-For thread safety, each method call will acquire an exclusive lock to
-the Getopt::Long module. So don't call these methods from a callback
-routine!
+=head2 Thread Safety
+
+Getopt::Long is thread safe when using ithreads as of Perl 5.8.  It is
+I<not> thread safe when using the older (experimental and now
+obsolete) threads implementation that was added to Perl 5.005.
 
 =head2 Documentation and help texts
 
index 95489d5..5ed7d90 100644 (file)
@@ -1,3 +1,12 @@
+Changes in version 2.32
+-----------------------
+
+* Fix a bug where the initial value for a optional numeric argument
+was not used for value of a hash option.
+
+* Remove 5.005 thread safety code. Getopt::Long is completely thread
+safe when using the 5.8 ithreads.
+
 Changes in version 2.29
 -----------------------
 
index 5cb6eff..8aa7748 100644 (file)
@@ -294,17 +294,30 @@ sub Croaker
     croak @_ ;
 }
 
-sub bits {
-    my $mask ;
+sub bits
+{
+    # called from B::Deparse.pm
+
+    push @_, 'all' unless @_;
+
+    my $mask;
     my $catmask ;
     my $fatal = 0 ;
-    foreach my $word (@_) {
-       if  ($word eq 'FATAL') {
+    my $no_fatal = 0 ;
+
+    foreach my $word ( @_ ) {
+       if ($word eq 'FATAL') {
            $fatal = 1;
+           $no_fatal = 0;
+       }
+       elsif ($word eq 'NONFATAL') {
+           $fatal = 0;
+           $no_fatal = 1;
        }
        elsif ($catmask = $Bits{$word}) {
            $mask |= $catmask ;
            $mask |= $DeadBits{$word} if $fatal ;
+           $mask &= ~($DeadBits{$word}|$All) if $no_fatal ;
        }
        else
           { Croaker("Unknown warnings category '$word'")}
@@ -313,24 +326,70 @@ sub bits {
     return $mask ;
 }
 
-sub import {
+sub import 
+{
     shift;
+
+    my $catmask ;
+    my $fatal = 0 ;
+    my $no_fatal = 0 ;
+
     my $mask = ${^WARNING_BITS} ;
+
     if (vec($mask, $Offsets{'all'}, 1)) {
         $mask |= $Bits{'all'} ;
         $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1);
     }
-    ${^WARNING_BITS} = $mask | bits(@_ ? @_ : 'all') ;
+    
+    push @_, 'all' unless @_;
+
+    foreach my $word ( @_ ) {
+       if ($word eq 'FATAL') {
+           $fatal = 1;
+           $no_fatal = 0;
+       }
+       elsif ($word eq 'NONFATAL') {
+           $fatal = 0;
+           $no_fatal = 1;
+       }
+       elsif ($catmask = $Bits{$word}) {
+           $mask |= $catmask ;
+           $mask |= $DeadBits{$word} if $fatal ;
+           $mask &= ~($DeadBits{$word}|$All) if $no_fatal ;
+       }
+       else
+          { Croaker("Unknown warnings category '$word'")}
+    }
+
+    ${^WARNING_BITS} = $mask ;
 }
 
-sub unimport {
+sub unimport 
+{
     shift;
+
+    my $catmask ;
     my $mask = ${^WARNING_BITS} ;
+
     if (vec($mask, $Offsets{'all'}, 1)) {
         $mask |= $Bits{'all'} ;
         $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1);
     }
-    ${^WARNING_BITS} = $mask & ~ (bits('FATAL' => (@_ ? @_ : 'all')) | $All) ;
+
+    push @_, 'all' unless @_;
+
+    foreach my $word ( @_ ) {
+       if ($word eq 'FATAL') {
+           next; 
+       }
+       elsif ($catmask = $Bits{$word}) {
+           $mask &= ~($catmask | $DeadBits{$word} | $All);
+       }
+       else
+          { Croaker("Unknown warnings category '$word'")}
+    }
+
+    ${^WARNING_BITS} = $mask ;
 }
 
 sub __chk
index 135e86a..b193e0c 100644 (file)
--- a/numeric.c
+++ b/numeric.c
@@ -727,10 +727,6 @@ S_mulexp10(NV value, I32 exponent)
 
     if (exponent == 0)
        return value;
-    else if (exponent < 0) {
-       negative = 1;
-       exponent = -exponent;
-    }
 
     /* On OpenVMS VAX we by default use the D_FLOAT double format,
      * and that format does not have *easy* capabilities [1] for
@@ -743,11 +739,6 @@ S_mulexp10(NV value, I32 exponent)
      *
      * [1] Trying to establish a condition handler to trap floating point
      *     exceptions is not a good idea. */
-    /* UNICOS fp is similarly non-IEEE. */
-#if ((defined(VMS) && !defined(__IEEE_FP)) || defined(_UNICOS)) && defined(NV_MAX_10_EXP)
-    if ((log10(value) + exponent) >= (NV_MAX_10_EXP))
-        return negative ? 0.0 : NV_MAX;
-#endif
 
     /* In UNICOS and in certain Cray models (such as T90) there is no
      * IEEE fp, and no way at all from C to catch fp overflows gracefully.
@@ -756,12 +747,28 @@ S_mulexp10(NV value, I32 exponent)
      * disable *all* floating point interrupts, a little bit too large
      * a hammer.  Therefore we need to catch potential overflows before
      * it's too late. */
-#if defined(_UNICOS) && defined(NV_MAX_10_EXP)
-    if (!negative &&
-       (log10(value) + exponent) >= NV_MAX_10_EXP)
-        return NV_MAX;
+
+#if ((defined(VMS) && !defined(__IEEE_FP)) || defined(_UNICOS)) && defined(NV_MAX_10_EXP)
+    STMT_START {
+       NV exp_v = log10(value);
+       if (exponent >= NV_MAX_10_EXP || exponent + exp_v >= NV_MAX_10_EXP)
+           return NV_MAX;
+       if (exponent < 0) {
+           if (-(exponent + exp_v) >= NV_MAX_10_EXP)
+               return 0.0;
+           while (-exponent >= NV_MAX_10_EXP) {
+               /* combination does not overflow, but 10^(-exponent) does */
+               value /= 10;
+               ++exponent;
+           }
+       }
+    } STMT_END;
 #endif
 
+    if (exponent < 0) {
+       negative = 1;
+       exponent = -exponent;
+    }
     for (bit = 1; exponent; bit <<= 1) {
        if (exponent & bit) {
            exponent ^= bit;
diff --git a/perl.h b/perl.h
index be0706c..d2f10c8 100644 (file)
--- a/perl.h
+++ b/perl.h
 #include <sys/fcntl.h>
 #endif
 
+#ifdef VOIDUSED
+#   undef VOIDUSED
+#endif 
 #define VOIDUSED 1
+
 #ifdef PERL_MICRO
 #   include "uconfig.h"
 #else
index b8751a3..b4c008a 100644 (file)
@@ -1052,7 +1052,7 @@ C<sort> is a new pragma for controlling the behaviour of sort().
 C<Storable> gives persistence to Perl data structures by allowing the
 storage and retrieval of Perl data to and from files in a fast and
 compact binary format.  Because in effect Storable does serialisation
-of Perl data structues, with it you can also clone deep, hierarchical
+of Perl data structures, with it you can also clone deep, hierarchical
 datastructures.  Storable was originally created by Raphael Manfredi,
 but it is now maintained by Abhijit Menon-Sen.  Storable has been
 enhanced to understand the two new hash features, Unicode keys and
@@ -1265,7 +1265,7 @@ enjoy the fixes.
 
 The arguments of WriteMakefile() in Makefile.PL are now checked
 for sanity much more carefully than before.  This may cause new
-warnings when modules are being insalled.  See L<ExtUtils::MakeMaker>
+warnings when modules are being installed.  See L<ExtUtils::MakeMaker>
 for more details.
 
 =item *
@@ -1982,8 +1982,8 @@ See L<perldgux>.
 
 =item *
 
-The DYNIX/ptx platform (a.k.a. dynixptx) is supported at or near
-osvers 4.5.2.
+The DYNIX/ptx platform (also known as dynixptx) is supported at or
+near osvers 4.5.2.
 
 =item *
 
index da4abe7..604da50 100644 (file)
@@ -328,9 +328,9 @@ to change during one "get".)
 
        Size_t fsize;
 
-Size of the function table. This is compared against the value PerlIO code "knows"
-as a compatibility check. Future versions I<may> be able to tolerate layers
-compiled against an old version of the headers.
+Size of the function table. This is compared against the value PerlIO
+code "knows" as a compatibility check. Future versions I<may> be able
+to tolerate layers compiled against an old version of the headers.
 
 =item name
 
@@ -352,9 +352,9 @@ The size of the per-instance data structure, e.g.:
 
   sizeof(PerlIOAPR)
 
-If this field is zero then C<PerlIO_pushed> does not malloc anything and assumes
-layer's Pushed function will do any required layer stack manipulation - used
-to avoid malloc/free overhead for dummy layers.
+If this field is zero then C<PerlIO_pushed> does not malloc anything
+and assumes layer's Pushed function will do any required layer stack
+manipulation - used to avoid malloc/free overhead for dummy layers.
 If the field is non-zero it must be at least the size of C<PerlIOl>,
 C<PerlIO_pushed> will allocate memory for the layer's data structures
 and link new layer onto the stream's stack. (If the layer's Pushed
@@ -454,10 +454,10 @@ special C<PerlIO_fdopen> calls; the C<'#'> prefix means that this is
 C<sysopen> and that I<imode> and I<perm> should be passed to
 C<PerlLIO_open3>; C<'r'> means B<r>ead, C<'w'> means B<w>rite and
 C<'a'> means B<a>ppend. The C<'+'> suffix means that both reading and
-writing/appending are permitted. The C<'b'> suffix means file should
-be binary, and C<'t'> means it is text. (Binary/Text should be ignored
-by almost all layers and binary IO done, with PerlIO. The C<:crlf>
-layer should be pushed to handle the distinction.)
+writing/appending are permitted.  The C<'b'> suffix means file should
+be binary, and C<'t'> means it is text. (Almost all layers should do
+the IO in binary mode, and ignore the b/t bits. The C<:crlf> layer
+should be pushed to handle the distinction.)
 
 If I<old> is not C<NULL> then this is a C<PerlIO_reopen>. Perl itself
 does not use this (yet?) and semantics are a little vague.
@@ -509,8 +509,8 @@ Returns the Unix/Posix numeric file descriptor for the handle. Normally
 C<PerlIOBase_fileno()> (which just asks next layer down) will suffice
 for this.
 
-Returns -1 on error, which is considered to include the case where the layer cannot
-provide such a file descriptor.
+Returns -1 on error, which is considered to include the case where the
+layer cannot provide such a file descriptor.
 
 =item Dup
 
@@ -519,8 +519,9 @@ provide such a file descriptor.
 
 XXX: Needs more docs.
 
-Used as part of the "clone" process when a thread is spawned (in which case
-param will be non-NULL) and when a stream is being duplicated via '&' in the C<open>.
+Used as part of the "clone" process when a thread is spawned (in which
+case param will be non-NULL) and when a stream is being duplicated via
+'&' in the C<open>.
 
 Similar to C<Open>, returns PerlIO* on success, C<NULL> on failure.
 
index 7b3ce3c..8ee7fc3 100644 (file)
@@ -351,13 +351,20 @@ The scope where C<length> is used has escalated the C<void> warnings
 category into a fatal error, so the program terminates immediately it
 encounters the warning.
 
-To explicitly disable a "FATAL" warning you just disable the warning it is
-associated with.  So, for example, to disable the "void" warning in the
-example above, either of these will do the trick:
+To explicitly turn off a "FATAL" warning you just disable the warning
+it is associated with.  So, for example, to disable the "void" warning
+in the example above, either of these will do the trick:
 
     no warnings qw(void);
     no warnings FATAL => qw(void);
 
+If you want to downgrade a warning that has been escalated into a fatal
+error back to a normal warning, you can use the "NONFATAL" keyword. For
+example, the code below will promote all warnings into fatal errors,
+except for those in the "syntax" category.
+
+    use warnings FATAL => 'all', NONFATAL => 'syntax';
+
 =head2 Reporting Warnings from a Module
 
 The C<warnings> pragma provides a number of functions that are useful for
index beb6a42..a7fdb8f 100644 (file)
@@ -567,10 +567,6 @@ Portably perform operations on file names
 
 File::Spec for Mac OS (Classic)
 
-=item File::Spec::NW5
-
-Methods for NW5 file specs
-
 =item File::Spec::OS2
 
 Methods for OS/2 file specs
index 2ebc671..3890cfc 100644 (file)
@@ -950,7 +950,7 @@ default. (To turn off that behaviour use C<:bytes> layer.)
 
 =item :win32
 
-On Win32 platfroms this I<experimental> layer uses native "handle" IO
+On Win32 platforms this I<experimental> layer uses native "handle" IO
 rather than unix-like numeric file descriptor layer. Known to be
 buggy in this release.
 
@@ -958,7 +958,7 @@ buggy in this release.
 
 On all platforms the default set of layers should give acceptable results.
 
-For UNIX platfroms that will equivalent of "unix perlio" or "stdio".
+For UNIX platforms that will equivalent of "unix perlio" or "stdio".
 Configure is setup to prefer "stdio" implementation if system's library
 provides for fast access to the buffer, otherwise it uses the "unix perlio"
 implementation.
index 52cdd6a..190e5f8 100644 (file)
@@ -960,8 +960,8 @@ subname [condition], b postpone subname [condition], b load filename, b
 compile subname, B line, B *, a [line] command, A line, A *, w expr, W
 expr, W *, o, o booloption .., o anyoption? .., o option=value .., < ?, < [
 command ], << command, > ?, > command, >> command, { ?, { [ command ], {{
-command, ! number, ! -number, ! pattern, !! cmd, @ file, H -number, q or
-^D, R, |dbcmd, ||dbcmd, command, m expr, M, man [manpage]
+command, ! number, ! -number, ! pattern, !! cmd, source file, H -number, q
+or ^D, R, |dbcmd, ||dbcmd, command, m expr, M, man [manpage]
 
 =item Configurable Options
 
@@ -4661,10 +4661,11 @@ PERLIO_F_TEMP, PERLIO_F_OPEN, PERLIO_F_FASTGETS
 
 =item Methods in Detail
 
-name, size, kind, PERLIO_K_BUFFERED, PERLIO_K_CANCRLF, PERLIO_K_FASTGETS,
-PERLIO_K_MULTIARG, PERLIO_K_RAW, Pushed, Popped, Open, Getarg, Fileno, Dup,
-Read, Write, Seek, Tell, Close, Flush, Fill, Eof, Error,  Clearerr,
-Setlinebuf, Get_base, Get_bufsiz, Get_ptr, Get_cnt, Set_ptrcnt
+size, name, size, kind, PERLIO_K_BUFFERED, PERLIO_K_RAW, PERLIO_K_CANCRLF,
+PERLIO_K_FASTGETS, PERLIO_K_MULTIARG, Pushed, Popped, Open, Binmode,
+Getarg, Fileno, Dup, Read, Write, Seek, Tell, Close, Flush, Fill, Eof,
+Error, Clearerr, Setlinebuf, Get_base, Get_bufsiz, Get_ptr, Get_cnt,
+Set_ptrcnt
 
 =item Core Layers
 
@@ -5351,7 +5352,7 @@ I<The Road goes ever on and on, down from the door where it began.>
 
 =item FreeBSD built with ithreads coredumps reading large directories
 
-=item FreeBSD Failing locale Test 117 For ISO8859-15 Locales
+=item FreeBSD Failing locale Test 117 For ISO 8859-15 Locales
 
 =item IRIX fails ext/List/Util/t/shuffle.t
 
@@ -5389,6 +5390,8 @@ I<The Road goes ever on and on, down from the door where it began.>
 
 =item Timing problems
 
+=item Unicode in package/class and subroutine names does not work
+
 =item UNICOS/mk
 
 =item UTS
@@ -7441,7 +7444,7 @@ DJGPP, Pthreads
 
 =item Malloc in Irix
 
-=item Building with threads
+=item Building with threads in Irix
 
 =back
 
@@ -9130,6 +9133,8 @@ utf8::valid(STRING)
 
 =back
 
+=item BUGS
+
 =item SEE ALSO
 
 =back
@@ -12980,15 +12985,15 @@ INSTALLDIRS, INSTALLMAN1DIR, INSTALLMAN3DIR, INSTALLPRIVLIB, INSTALLSCRIPT,
 INSTALLSITEARCH, INSTALLSITEBIN, INSTALLSITELIB, INSTALLSITEMAN1DIR,
 INSTALLSITEMAN3DIR, INSTALLVENDORARCH, INSTALLVENDORBIN, INSTALLVENDORLIB,
 INSTALLVENDORMAN1DIR, INSTALLVENDORMAN3DIR, INST_ARCHLIB, INST_BIN,
-INST_LIB, INST_MAN1DIR, INST_MAN3DIR, INST_SCRIPT, LDFROM, LIB, LIBPERL_A,
-LIBS, LINKTYPE, MAKEAPERL, MAKEFILE, MAN1PODS, MAN3PODS, MAP_TARGET,
-MYEXTLIB, NAME, NEEDS_LINKING, NOECHO, NORECURS, NO_VC, OBJECT, OPTIMIZE,
-PERL, PERL_CORE, PERLMAINCC, PERL_ARCHLIB, PERL_LIB, PERL_MALLOC_OK,
-PERLRUN, PERLRUNINST, PERL_SRC, PERM_RW, PERM_RWX, PL_FILES, PM, PMLIBDIRS,
-PM_FILTER, POLLUTE, PPM_INSTALL_EXEC, PPM_INSTALL_SCRIPT, PREFIX,
-PREREQ_FATAL, PREREQ_PM, PREREQ_PRINT, PRINT_PREREQ, SITEPREFIX, SKIP,
-TYPEMAPS, VENDORPREFIX, VERBINST, VERSION, VERSION_FROM, XS, XSOPT,
-XSPROTOARG, XS_VERSION
+INST_LIB, INST_MAN1DIR, INST_MAN3DIR, INST_SCRIPT, LDDLFLAGS, LDFROM, LIB,
+LIBPERL_A, LIBS, LINKTYPE, MAKEAPERL, MAKEFILE, MAN1PODS, MAN3PODS,
+MAP_TARGET, MYEXTLIB, NAME, NEEDS_LINKING, NOECHO, NORECURS, NO_VC, OBJECT,
+OPTIMIZE, PERL, PERL_CORE, PERLMAINCC, PERL_ARCHLIB, PERL_LIB,
+PERL_MALLOC_OK, PERLRUN, PERLRUNINST, PERL_SRC, PERM_RW, PERM_RWX,
+PL_FILES, PM, PMLIBDIRS, PM_FILTER, POLLUTE, PPM_INSTALL_EXEC,
+PPM_INSTALL_SCRIPT, PREFIX, PREREQ_FATAL, PREREQ_PM, PREREQ_PRINT,
+PRINT_PREREQ, SITEPREFIX, SKIP, TYPEMAPS, VENDORPREFIX, VERBINST, VERSION,
+VERSION_FROM, XS, XSOPT, XSPROTOARG, XS_VERSION
 
 =item Additional lowercase attributes
 
@@ -12997,6 +13002,10 @@ tool_autosplit
 
 =item Overriding MakeMaker Methods
 
+=item The End Of Cargo Cult Programming
+
+C<<MAN3PODS => ' '>>
+
 =item Hintsfile support
 
 =item Distribution Support
@@ -13421,36 +13430,6 @@ rel2abs
 
 =back
 
-=head2 File::Spec::NW5 - methods for NW5 file specs
-
-=over 4
-
-=item SYNOPSIS
-
-=item DESCRIPTION
-
-devnull
-
-=back
-
-tmpdir
-
-catfile
-
-canonpath
-
-splitpath
-
-splitdir
-
-catpath
-
-=over 4
-
-=item SEE ALSO
-
-=back
-
 canonpath
 
 splitpath
@@ -13608,6 +13587,12 @@ catpath
 
 =over 4
 
+=item Note For File::Spec::Win32 Maintainers
+
+=back
+
+=over 4
+
 =item SEE ALSO
 
 =back
@@ -13914,6 +13899,8 @@ B<$_>, B<$status>, B<filter_read> and B<filter_read_exact>, B<filter_del>
 
 =item Object oriented interface
 
+=item Thread Safety
+
 =item Documentation and help texts
 
 =item Storing options in a hash
@@ -16563,6 +16550,8 @@ unix, stdio, perlio, crlf, utf8, bytes, raw
 
 =over 4
 
+=item Alternatives to raw
+
 =item Defaults and how to override them
 
 =back
@@ -16592,12 +16581,13 @@ unix, stdio, perlio, crlf, utf8, bytes, raw
 =item DESCRIPTION
 
 $class->PUSHED([$mode[,$fh]]), $obj->POPPED([$fh]),
-$class->OPEN($path,$mode[,$fh]), $class->FDOPEN($fd),
-$class->SYSOPEN($path,$imode,$perm,$fh), $obj->FILENO($fh),
-$obj->READ($buffer,$len,$fh), $obj->WRITE($buffer,$fh), $obj->FILL($fh),
-$obj->CLOSE($fh), $obj->SEEK($posn,$whence,$fh), $obj->TELL($fh),
-$obj->UNREAD($buffer,$fh), $obj->FLUSH($fh), $obj->SETLINEBUF($fh),
-$obj->CLEARERR($fh), $obj->ERROR($fh), $obj->EOF($fh)
+$class->OPEN($path,$mode[,$fh]), $obj->BINMODE([,$fh]),
+$class->FDOPEN($fd), $class->SYSOPEN($path,$imode,$perm,$fh),
+$obj->FILENO($fh), $obj->READ($buffer,$len,$fh), $obj->WRITE($buffer,$fh),
+$obj->FILL($fh), $obj->CLOSE($fh), $obj->SEEK($posn,$whence,$fh),
+$obj->TELL($fh), $obj->UNREAD($buffer,$fh), $obj->FLUSH($fh),
+$obj->SETLINEBUF($fh), $obj->CLEARERR($fh), $obj->ERROR($fh),
+$obj->EOF($fh)
 
 =over 4
 
@@ -18409,6 +18399,8 @@ B<_my_exit>
 
 =over 4
 
+=item THREADS
+
 =item EXAMPLES
 
 =item SEE ALSO
@@ -18671,6 +18663,8 @@ B<SKIP: BLOCK>
 
 B<TODO: BLOCK>, B<todo_skip>
 
+When do I use SKIP vs. TODO?
+
 =over 4
 
 =item Comparison functions
index 23c88d8..a3e70f8 100644 (file)
@@ -356,3 +356,71 @@ my $b ; chop $b;
 print STDERR "The End.\n" ;
 EXPECT
 Use of uninitialized value in scalar chop at - line 7.
+########
+
+use warnings FATAL => 'syntax', NONFATAL => 'void' ;
+
+length "abc";
+print STDERR "The End.\n" ;
+EXPECT
+Useless use of length in void context at - line 4.
+The End.
+########
+
+use warnings FATAL => 'all', NONFATAL => 'void' ;
+
+length "abc";
+print STDERR "The End.\n" ;
+EXPECT
+Useless use of length in void context at - line 4.
+The End.
+########
+
+use warnings FATAL => 'all', NONFATAL => 'void' ;
+
+my $a ; chomp $a;
+length "abc";
+print STDERR "The End.\n" ;
+EXPECT
+Useless use of length in void context at - line 5.
+Use of uninitialized value in scalar chomp at - line 4.
+########
+
+use warnings FATAL => 'void', NONFATAL => 'void' ;
+
+length "abc";
+print STDERR "The End.\n" ;
+EXPECT
+Useless use of length in void context at - line 4.
+The End.
+########
+
+use warnings NONFATAL => 'void', FATAL => 'void' ;
+
+length "abc";
+print STDERR "The End.\n" ;
+EXPECT
+Useless use of length in void context at - line 4.
+########
+
+use warnings FATAL => 'all', NONFATAL => 'io';
+no warnings 'once';
+
+open(F, "<true\ncd");
+close "fred" ;
+print STDERR "The End.\n" ;
+EXPECT
+Unsuccessful open on filename containing newline at - line 5.
+close() on unopened filehandle fred at - line 6.
+The End.
+########
+
+use warnings FATAL => 'all', NONFATAL => 'io', FATAL => 'unopened' ;
+no warnings 'once';
+
+open(F, "<true\ncd");
+close "fred" ;
+print STDERR "The End.\n" ;
+EXPECT
+Unsuccessful open on filename containing newline at - line 5.
+close() on unopened filehandle fred at - line 6.
index cffe40e..c8b7efe 100644 (file)
--- a/uconfig.h
+++ b/uconfig.h
 
 /* HAS_GNULIBC:
  *     This symbol, if defined, indicates to the C program that 
- *     the GNU C library is being used.
+ *     the GNU C library is being used.  A better check is to use
+ *     the __GLIBC__ and __GLIBC_MINOR__ symbols supplied with glibc.
  */
 /*#define HAS_GNULIBC          / **/
 #if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)
index 680adfb..322b568 100644 (file)
 
 /* HAS_GNULIBC:
  *     This symbol, if defined, indicates to the C program that 
- *     the GNU C library is being used.
+ *     the GNU C library is being used.  A better check is to use
+ *     the __GLIBC__ and __GLIBC_MINOR__ symbols supplied with glibc.
  */
 /*#define HAS_GNULIBC          /**/
 #if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)
index 3339610..b5b2953 100644 (file)
 
 /* HAS_GNULIBC:
  *     This symbol, if defined, indicates to the C program that 
- *     the GNU C library is being used.
+ *     the GNU C library is being used.  A better check is to use
+ *     the __GLIBC__ and __GLIBC_MINOR__ symbols supplied with glibc.
  */
 /*#define HAS_GNULIBC          /**/
 #if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)
index 75778a1..586e5a7 100644 (file)
@@ -607,17 +607,30 @@ sub Croaker
     croak @_ ;
 }
 
-sub bits {
-    my $mask ;
+sub bits
+{
+    # called from B::Deparse.pm
+
+    push @_, 'all' unless @_;
+
+    my $mask;
     my $catmask ;
     my $fatal = 0 ;
-    foreach my $word (@_) {
-       if  ($word eq 'FATAL') {
+    my $no_fatal = 0 ;
+
+    foreach my $word ( @_ ) {
+       if ($word eq 'FATAL') {
            $fatal = 1;
+           $no_fatal = 0;
+       }
+       elsif ($word eq 'NONFATAL') {
+           $fatal = 0;
+           $no_fatal = 1;
        }
        elsif ($catmask = $Bits{$word}) {
            $mask |= $catmask ;
            $mask |= $DeadBits{$word} if $fatal ;
+           $mask &= ~($DeadBits{$word}|$All) if $no_fatal ;
        }
        else
           { Croaker("Unknown warnings category '$word'")}
@@ -626,24 +639,70 @@ sub bits {
     return $mask ;
 }
 
-sub import {
+sub import 
+{
     shift;
+
+    my $catmask ;
+    my $fatal = 0 ;
+    my $no_fatal = 0 ;
+
     my $mask = ${^WARNING_BITS} ;
+
     if (vec($mask, $Offsets{'all'}, 1)) {
         $mask |= $Bits{'all'} ;
         $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1);
     }
-    ${^WARNING_BITS} = $mask | bits(@_ ? @_ : 'all') ;
+    
+    push @_, 'all' unless @_;
+
+    foreach my $word ( @_ ) {
+       if ($word eq 'FATAL') {
+           $fatal = 1;
+           $no_fatal = 0;
+       }
+       elsif ($word eq 'NONFATAL') {
+           $fatal = 0;
+           $no_fatal = 1;
+       }
+       elsif ($catmask = $Bits{$word}) {
+           $mask |= $catmask ;
+           $mask |= $DeadBits{$word} if $fatal ;
+           $mask &= ~($DeadBits{$word}|$All) if $no_fatal ;
+       }
+       else
+          { Croaker("Unknown warnings category '$word'")}
+    }
+
+    ${^WARNING_BITS} = $mask ;
 }
 
-sub unimport {
+sub unimport 
+{
     shift;
+
+    my $catmask ;
     my $mask = ${^WARNING_BITS} ;
+
     if (vec($mask, $Offsets{'all'}, 1)) {
         $mask |= $Bits{'all'} ;
         $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1);
     }
-    ${^WARNING_BITS} = $mask & ~ (bits('FATAL' => (@_ ? @_ : 'all')) | $All) ;
+
+    push @_, 'all' unless @_;
+
+    foreach my $word ( @_ ) {
+       if ($word eq 'FATAL') {
+           next; 
+       }
+       elsif ($catmask = $Bits{$word}) {
+           $mask &= ~($catmask | $DeadBits{$word} | $All);
+       }
+       else
+          { Croaker("Unknown warnings category '$word'")}
+    }
+
+    ${^WARNING_BITS} = $mask ;
 }
 
 sub __chk
index 3e4e80c..3d08698 100644 (file)
 
 /* HAS_GNULIBC:
  *     This symbol, if defined, indicates to the C program that 
- *     the GNU C library is being used.
+ *     the GNU C library is being used.  A better check is to use
+ *     the __GLIBC__ and __GLIBC_MINOR__ symbols supplied with glibc.
  */
 /*#define HAS_GNULIBC          /**/
 #if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)
index a968ec6..b65a45d 100644 (file)
 
 /* HAS_GNULIBC:
  *     This symbol, if defined, indicates to the C program that 
- *     the GNU C library is being used.
+ *     the GNU C library is being used.  A better check is to use
+ *     the __GLIBC__ and __GLIBC_MINOR__ symbols supplied with glibc.
  */
 /*#define HAS_GNULIBC          /**/
 #if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)
index bc81d7c..7d64e6b 100644 (file)
 
 /* HAS_GNULIBC:
  *     This symbol, if defined, indicates to the C program that 
- *     the GNU C library is being used.
+ *     the GNU C library is being used.  A better check is to use
+ *     the __GLIBC__ and __GLIBC_MINOR__ symbols supplied with glibc.
  */
 /*#define HAS_GNULIBC          /**/
 #if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)
index ac25851..d2b6bc6 100644 (file)
 
 /* HAS_GNULIBC:
  *     This symbol, if defined, indicates to the C program that 
- *     the GNU C library is being used.
+ *     the GNU C library is being used.  A better check is to use
+ *     the __GLIBC__ and __GLIBC_MINOR__ symbols supplied with glibc.
  */
 /*#define HAS_GNULIBC          /**/
 #if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)
index 364ea11..30e855a 100644 (file)
 
 /* HAS_GNULIBC:
  *     This symbol, if defined, indicates to the C program that 
- *     the GNU C library is being used.
+ *     the GNU C library is being used.  A better check is to use
+ *     the __GLIBC__ and __GLIBC_MINOR__ symbols supplied with glibc.
  */
 /*#define HAS_GNULIBC          /**/
 #if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)