Basic bad prototype detection
[p5sagit/p5-mst-13.2.git] / pod / perldiag.pod
index 365faa6..8ee25f2 100644 (file)
@@ -611,7 +611,7 @@ line.
 
 =item Can't exec "%s": %s
 
-(W exec) An system(), exec(), or piped open call could not execute the
+(W exec) A system(), exec(), or piped open call could not execute the
 named program for the indicated reason.  Typical reasons include: the
 permissions were wrong on the file, the file wasn't found in
 C<$ENV{PATH}>, the executable in question was compiled for another
@@ -1629,17 +1629,17 @@ two from 1 to 32 (or 64, if your platform supports that).
 
 =item Illegal octal digit %s
 
-(F) You used an 8 or 9 in a octal number.
+(F) You used an 8 or 9 in an octal number.
 
 =item Illegal octal digit %s ignored
 
-(W digit) You may have tried to use an 8 or 9 in a octal number.
+(W digit) You may have tried to use an 8 or 9 in an octal number.
 Interpretation of the octal number stopped before the 8 or 9.
 
 =item Illegal switch in PERL5OPT: %s
 
 (X) The PERL5OPT environment variable may only be used to set the
-following switches: B<-[DIMUdmw]>.
+following switches: B<-[DIMUdmtw]>.
 
 =item Ill-formed CRTL environ value "%s"
 
@@ -1837,7 +1837,7 @@ L<perlfunc/listen>.
 
 =item lstat() on filehandle %s
 
-(W io) You tried to do a lstat on a filehandle.  What did you mean
+(W io) You tried to do an lstat on a filehandle.  What did you mean
 by that?  lstat() makes sense only on filenames.  (Perl did a fstat()
 instead on the filehandle.)
 
@@ -1869,6 +1869,13 @@ a builtin library search path, prefix2 is substituted.  The error may
 appear if components are not found, or are too long.  See
 "PERLLIB_PREFIX" in L<perlos2>.
 
+=item Malformed prototype for %s: %s
+
+(F) You declared or tried to use a function with a malformed
+prototype.  The syntax of function prototypes is given a brief
+compile-time check for obvious errors like invalid characters.  A more
+rigorous check is run when the function is called.
+
 =item Malformed UTF-8 character (%s)
 
 Perl detected something that didn't comply with UTF-8 encoding rules.
@@ -2688,7 +2695,7 @@ the result of the value of the environment variable PERLIO.
 =item perlio: invalid separator character %s in attribute list
 
 (S) When pushing layers onto the Perl I/O system, something other than a
-colon or whitespace was seen between the elements of an layer list.
+colon or whitespace was seen between the elements of a layer list.
 If the previous attribute had a parenthesised parameter list, perhaps that
 list was terminated too soon.
 
@@ -2711,6 +2718,10 @@ value of the environment variable PERLIO.
 process which isn't a subprocess of the current process.  While this is
 fine from VMS' perspective, it's probably not what you intended.
 
+=item P must have an explicit size
+
+(F) The unpack format P must have an explicit size, not "*".
+
 =item POSIX syntax [%s] belongs inside character classes in regex;
 
 marked by <-- HERE in m/%s/
@@ -3284,13 +3295,13 @@ L<perlop/"Quote and Quote-like Operators">.
 
 =item Substitution pattern not terminated
 
-(F) The lexer couldn't find the interior delimiter of a s/// or s{}{}
+(F) The lexer couldn't find the interior delimiter of an s/// or s{}{}
 construct.  Remember that bracketing delimiters count nesting level.
 Missing the leading C<$> from variable C<$s> may cause this error.
 
 =item Substitution replacement not terminated
 
-(F) The lexer couldn't find the final delimiter of a s/// or s{}{}
+(F) The lexer couldn't find the final delimiter of an s/// or s{}{}
 construct.  Remember that bracketing delimiters count nesting level.
 Missing the leading C<$> from variable C<$s> may cause this error.
 
@@ -3599,6 +3610,11 @@ Check the #! line, or manually feed your script into Perl yourself.
 (F) The unexec() routine failed for some reason.  See your local FSF
 representative, who probably put it there in the first place.
 
+=item Unicode character %s is illegal
+
+(W utf8) Certain Unicode characters have been designated off-limits by
+the Unicode standard and should not be generated.  If you really know
+what you are doing you can turn off this warning by C<no warnings 'utf8';>.
 
 =item Unknown BYTEORDER
 
@@ -3844,6 +3860,14 @@ about.
 
 (W) You did C<use re;> without any arguments.   That isn't very useful.
 
+=item Useless use of sort in scalar context
+
+(W void) You used sort in scalar context, as in :
+
+    my $x = sort @y;
+
+This is not very useful, and perl currently optimizes this away.
+
 =item Useless use of %s with no values
 
 (W syntax) You used the push() or unshift() function with no arguments
@@ -3986,6 +4010,16 @@ C<< @foo->[23] >> or C<< @$ref->[99] >>.  Versions of perl <= 5.6.1 used to
 allow this syntax, but shouldn't have. It is now deprecated, and will be
 removed in a future version.
 
+=item UTF-16 surrogate %s
+
+(W utf8) You tried to generate half of an UTF-16 surrogate by
+requesting a Unicode character between the code points 0xD800 and
+0xDFFF (inclusive).  That range is reserved exclusively for the use of
+UTF-16 encoding (by having two 16-bit UCS-2 characters); but Perl
+encodes its characters in UTF-8, so what you got is a very illegal
+character.  If you really know what you are doing you can turn off
+this warning by C<no warnings 'utf8';>.
+
 =item Value of %s can be "0"; test with defined()
 
 (W misc) In a conditional expression, you used <HANDLE>, <*> (glob),