From 4c2e59a08d6dafdbcf19a27a1f495e6cbf668d82 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 3 Jan 2014 08:00:32 -0700 Subject: [PATCH] perldiag.pod: Correct some categories The warning categories were wrong in a few places here. diag.t had them as to ignore. By correcting them in the pod, they can be removed from the ignore list. This commit additionally adds text for a few messages that can be either fatal or just warnings. --- pod/perldiag.pod | 14 ++++++++------ t/porting/diag.t | 6 ------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/pod/perldiag.pod b/pod/perldiag.pod index b918573..f847a75 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1946,7 +1946,8 @@ queue of such routines has been prematurely ended. =item False [] range "%s" in regex; marked by S<<-- HERE> in m/%s/ -(W regexp)(F) A character class range must start and end at a literal +(W regexp) (fatal within S>) +A character class range must start and end at a literal character, not another character class like C<\d> or C<[:alpha:]>. The "-" in your false range is interpreted as a literal "-". In a C<(?[...])> construct, this is an error, rather than a warning. Consider quoting @@ -2512,7 +2513,8 @@ L. =item Invalid escape in the specified encoding in regex; marked by S<<-- HERE> in m/%s/ -(W regexp) The numeric escape (for example C<\xHH>) of value < 256 +(W regexp) (fatal within S>) +The numeric escape (for example C<\xHH>) of value < 256 didn't correspond to a single character through the conversion from the encoding specified by the encoding pragma. The escape was replaced with REPLACEMENT CHARACTER (U+FFFD) instead. @@ -3684,7 +3686,7 @@ C. =item Operation "%s" returns its argument for UTF-16 surrogate U+%X -(S utf8, surrogate) You performed an operation requiring Unicode +(S surrogate) You performed an operation requiring Unicode semantics on a Unicode surrogate. Unicode frowns upon the use of surrogates for anything but storing strings in UTF-16, but semantics are (reluctantly) defined for the surrogates, and they are to do @@ -5577,7 +5579,7 @@ with the characters in the Lao and Thai scripts. =item Unicode non-character U+%X is illegal for open interchange -(S utf8, nonchar) Certain codepoints, such as U+FFFE and U+FFFF, are +(S nonchar) Certain codepoints, such as U+FFFE and U+FFFF, are defined by the Unicode standard to be non-characters. Those are legal codepoints, but are reserved for internal use; so, applications shouldn't attempt to exchange them. If you know what you are doing @@ -5585,7 +5587,7 @@ you can turn off this warning by C. =item Unicode surrogate U+%X is illegal in UTF-8 -(S utf8, surrogate) You had a UTF-16 surrogate in a context where they are +(S surrogate) You had a UTF-16 surrogate in a context where they are not considered acceptable. These code points, between U+D800 and U+DFFF (inclusive), are used by Unicode only for UTF-16. However, Perl internally allows all unsigned integer code points (up to the size limit @@ -6314,7 +6316,7 @@ modified string is usually not particularly useful.) =item UTF-16 surrogate U+%X -(S utf8, surrogate) You had a UTF-16 surrogate in a context where they are +(S surrogate) You had a UTF-16 surrogate in a context where they are not considered acceptable. These code points, between U+D800 and U+DFFF (inclusive), are used by Unicode only for UTF-16. However, Perl internally allows all unsigned integer code points (up to the size limit diff --git a/t/porting/diag.t b/t/porting/diag.t index 6119aed..74267b4 100644 --- a/t/porting/diag.t +++ b/t/porting/diag.t @@ -672,12 +672,6 @@ Wrong syntax (suid) fd script name "%s" 'X' outside of string in unpack __CATEGORIES__ -Code point 0x%X is not Unicode, may not be portable Illegal character \%o (carriage return) Missing argument in %s -Unicode non-character U+%X is illegal for open interchange -Operation "%s" returns its argument for non-Unicode code point 0x%X -Operation "%s" returns its argument for UTF-16 surrogate U+%X -Unicode surrogate U+%X is illegal in UTF-8 -UTF-16 surrogate U+%X False [] range "%s" in regex; marked by <-- HERE in m/%s/ -- 2.7.4