summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2014-07-21 10:41:20 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2014-07-22 21:31:41 -0400
commit6313e54401f5531a23184b7afaaf6bc7cd4a81ec (patch)
tree8a09ae74353a6697f0e652b1d8577441f3cb456e /proto.h
parent6e75769d300856d7c215fc22d503cce13b734a0f (diff)
downloadperl-6313e54401f5531a23184b7afaaf6bc7cd4a81ec.tar.gz
Implement grok_atou as safe/strict atoi replacement.
For earlier discussion, see: http://www.nntp.perl.org/group/perl.perl5.porters/2013/10/msg208680.html https://rt.perl.org/Public/Bug/Display.html?id=116118#txn-1250187 grok_atou is completely new code, instead of trying to bolt new parameters/flags to grok_number. This makes it easier to be extremely strict, and not worry about breaking grok_number.
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/proto.h b/proto.h
index 49a44d2bb9..1eccc462d3 100644
--- a/proto.h
+++ b/proto.h
@@ -1289,6 +1289,11 @@ PERL_CALLCONV int Perl_getcwd_sv(pTHX_ SV* sv)
PERL_CALLCONV void Perl_gp_free(pTHX_ GV* gv);
PERL_CALLCONV GP* Perl_gp_ref(pTHX_ GP* gp);
+PERL_CALLCONV Size_t Perl_grok_atou(const char* pv, const char** endptr)
+ __attribute__nonnull__(1);
+#define PERL_ARGS_ASSERT_GROK_ATOU \
+ assert(pv)
+
PERL_CALLCONV UV Perl_grok_bin(pTHX_ const char* start, STRLEN* len_p, I32* flags, NV *result)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2)