This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
better "Illegal %s digit ignored" warnings
authorGurusamy Sarathy <gsar@cpan.org>
Wed, 24 Mar 1999 02:50:20 +0000 (02:50 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Wed, 24 Mar 1999 02:50:20 +0000 (02:50 +0000)
p4raw-id: //depot/perl@3137

MANIFEST
pod/perldiag.pod
pod/perlfunc.pod
t/pragma/warn/util
toke.c
util.c

index c413a2a..2620c5f 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1268,6 +1268,7 @@ t/pragma/strict-subs      Tests of "use strict 'subs'" for strict.t
 t/pragma/strict-vars   Tests of "use strict 'vars'" for strict.t
 t/pragma/strict.t      See if strictures work
 t/pragma/subs.t                See if subroutine pseudo-importation works
+t/pragma/utf8.t                See if utf8 operations work
 t/pragma/warn/1global  Tests of global warnings for warning.t
 t/pragma/warn/2use     Tests for "use warning" for warning.t
 t/pragma/warn/3both    Tests for interaction of $^W and "use warning"
index 81099d3..fb6d139 100644 (file)
@@ -1378,16 +1378,25 @@ logic, or you need to put a conditional in to guard against meaningless input.
 (F) You tried to divide a number by 0 to get the remainder.  Most numbers
 don't take to this kindly.
 
-=item Illegal octal digit
+=item Illegal binary digit %s
+
+(F) You used a digit other than 0 and 1 in a binary number.
+
+=item Illegal octal digit %s
 
 (F) You used an 8 or 9 in a octal number.
 
-=item Illegal octal digit ignored
+=item Illegal binary digit %s ignored
+
+(W) You may have tried to use a digit other than 0 or 1 in a binary number.
+Interpretation of the binary number stopped before the offending digit.
+
+=item Illegal octal digit %s ignored
 
 (W) You may have tried to use an 8 or 9 in a octal number.  Interpretation
 of the octal number stopped before the 8 or 9.
 
-=item Illegal hex digit ignored
+=item Illegal hex digit %s ignored
 
 (W) You may have tried to use a character other than 0 - 9 or A - F in a
 hexadecimal number.  Interpretation of the hexadecimal number stopped
index b8580ed..87f94f8 100644 (file)
@@ -3038,7 +3038,7 @@ This is the internal function implementing the C<qx/EXPR/>
 operator, but you can use it directly.  The C<qx/EXPR/>
 operator is discussed in more detail in L<perlop/"I/O Operators">.
 
-=item recv SOCKET,SCALAR,LEN,FLAGS
+=item recv SOCKET,SCALAR,LENGTH,FLAGS
 
 Receives a message on a socket.  Attempts to receive LENGTH bytes of
 data into variable SCALAR from the specified SOCKET filehandle.
index b63f89e..d58f4b7 100644 (file)
@@ -14,16 +14,16 @@ __END__
 use warning 'octal' ;
 my $a = oct "029" ;
 EXPECT
-Illegal octal digit ignored at - line 3.
+Illegal octal digit '9' ignored at - line 3.
 ########
 # util.c
 use warning 'unsafe' ;
 *a =  hex "0xv9" ;
 EXPECT
-Illegal hex digit ignored at - line 3.
+Illegal hex digit 'v' ignored at - line 3.
 ########
 # util.c
 use warning 'unsafe' ;
 *a =  oct "0b9" ;
 EXPECT
-Illegal binary digit ignored at - line 3.
+Illegal binary digit '9' ignored at - line 3.
diff --git a/toke.c b/toke.c
index 6340857..4b26a64 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -6058,17 +6058,17 @@ scan_num(char *start)
                /* 8 and 9 are not octal */
                case '8': case '9':
                    if (shift == 3)
-                       yyerror("Illegal octal digit");
+                       yyerror(form("Illegal octal digit '%c'", *s));
                    else
                        if (shift == 1)
-                           yyerror("Illegal binary digit");
+                           yyerror(form("Illegal binary digit '%c'", *s));
                    /* FALL THROUGH */
 
                /* octal digits */
                case '2': case '3': case '4':
                case '5': case '6': case '7':
                    if (shift == 1)
-                       yyerror("Illegal binary digit");
+                       yyerror(form("Illegal binary digit '%c'", *s));
                    /* FALL THROUGH */
 
                case '0': case '1':
diff --git a/util.c b/util.c
index 6b666e0..f08a593 100644 (file)
--- a/util.c
+++ b/util.c
@@ -2421,7 +2421,7 @@ scan_bin(char *start, I32 len, I32 *retlen)
     if (len && (*s >= '2' || *s <= '9')) {
       dTHR;
       if (ckWARN(WARN_UNSAFE))
-          warner(WARN_UNSAFE, "Illegal binary digit ignored");
+          warner(WARN_UNSAFE, "Illegal binary digit '%c' ignored", *s);
     }
     *retlen = s - start;
     return retval;
@@ -2445,7 +2445,7 @@ scan_oct(char *start, I32 len, I32 *retlen)
     if (len && (*s == '8' || *s == '9')) {
        dTHR;
        if (ckWARN(WARN_OCTAL))
-           warner(WARN_OCTAL, "Illegal octal digit ignored");
+           warner(WARN_OCTAL, "Illegal octal digit '%c' ignored", *s);
     }
     *retlen = s - start;
     return retval;
@@ -2469,7 +2469,7 @@ scan_hex(char *start, I32 len, I32 *retlen)
                dTHR;
                --s;
                if (ckWARN(WARN_UNSAFE))
-                   warner(WARN_UNSAFE,"Illegal hex digit ignored");
+                   warner(WARN_UNSAFE,"Illegal hex digit '%c' ignored", *s);
                break;
            }
        }