diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-05-15 20:52:02 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-07-03 14:05:47 -0600 |
commit | 024707869a10c357d61d9dfdfe74a7b386c92e25 (patch) | |
tree | 0e6ea78fbe08ae4b29813cec0d7a255c90aec3ce /numeric.c | |
parent | f1b67122022c4748336f3c81978e179361a149d3 (diff) | |
download | perl-024707869a10c357d61d9dfdfe74a7b386c92e25.tar.gz |
Add flag to num groks to silence non-portable warnings
Unicode inversion lists commonly will contain UV_MAX, which may
trigger these warnings. Add a flag to suppress them to the numeric
grok functions, which can be set by the code that is dealing with
these lists
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -131,6 +131,10 @@ C<PERL_SCAN_ALLOW_UNDERSCORES> is set in I<*flags> then the binary number may use '_' characters to separate digits. =cut + +Not documented yet because experimental is C<PERL_SCAN_SILENT_NON_PORTABLE +which suppresses any message for non-portable numbers that are still valid +on this platform. */ UV @@ -206,7 +210,8 @@ Perl_grok_bin(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) if ( ( overflowed && value_nv > 4294967295.0) #if UVSIZE > 4 - || (!overflowed && value > 0xffffffff ) + || (!overflowed && value > 0xffffffff + && ! (*flags & PERL_SCAN_SILENT_NON_PORTABLE)) #endif ) { Perl_ck_warner(aTHX_ packWARN(WARN_PORTABLE), @@ -248,6 +253,10 @@ C<PERL_SCAN_ALLOW_UNDERSCORES> is set in I<*flags> then the hex number may use '_' characters to separate digits. =cut + +Not documented yet because experimental is C<PERL_SCAN_SILENT_NON_PORTABLE +which suppresses any message for non-portable numbers that are still valid +on this platform. */ UV @@ -323,7 +332,8 @@ Perl_grok_hex(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) if ( ( overflowed && value_nv > 4294967295.0) #if UVSIZE > 4 - || (!overflowed && value > 0xffffffff ) + || (!overflowed && value > 0xffffffff + && ! (*flags & PERL_SCAN_SILENT_NON_PORTABLE)) #endif ) { Perl_ck_warner(aTHX_ packWARN(WARN_PORTABLE), @@ -363,6 +373,10 @@ If C<PERL_SCAN_ALLOW_UNDERSCORES> is set in I<*flags> then the octal number may use '_' characters to separate digits. =cut + +Not documented yet because experimental is C<PERL_SCAN_SILENT_NON_PORTABLE +which suppresses any message for non-portable numbers that are still valid +on this platform. */ UV @@ -428,7 +442,8 @@ Perl_grok_oct(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) if ( ( overflowed && value_nv > 4294967295.0) #if UVSIZE > 4 - || (!overflowed && value > 0xffffffff ) + || (!overflowed && value > 0xffffffff + && ! (*flags & PERL_SCAN_SILENT_NON_PORTABLE)) #endif ) { Perl_ck_warner(aTHX_ packWARN(WARN_PORTABLE), |