This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make (P)ure funcs in embed.fnc imply (R)eturn must be checked
[perl5.git] / proto.h
diff --git a/proto.h b/proto.h
index 228e84e..839bfdd 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -592,6 +592,7 @@ PERL_CALLCONV void  Perl_custom_op_register(pTHX_ Perl_ppaddr_t ppaddr, const XOP
 #define PERL_ARGS_ASSERT_CUSTOM_OP_REGISTER    \
        assert(ppaddr); assert(xop)
 /* PERL_CALLCONV const XOP *   Perl_custom_op_xop(pTHX_ const OP *o)
+                       __attribute__warn_unused_result__
                        __attribute__pure__; */
 
 PERL_CALLCONV void     Perl_cv_ckproto_len_flags(pTHX_ const CV* cv, const GV* gv, const char* p, const STRLEN len, const U32 flags);
@@ -869,16 +870,19 @@ PERL_CALLCONV char*       Perl_find_script(pTHX_ const char *scriptname, bool dosearch
 #define PERL_ARGS_ASSERT_FIND_SCRIPT   \
        assert(scriptname)
 PERL_CALLCONV I32      Perl_foldEQ(const char* a, const char* b, I32 len)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 #define PERL_ARGS_ASSERT_FOLDEQ        \
        assert(a); assert(b)
 
 PERL_CALLCONV I32      Perl_foldEQ_latin1(const char* a, const char* b, I32 len)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 #define PERL_ARGS_ASSERT_FOLDEQ_LATIN1 \
        assert(a); assert(b)
 
 PERL_CALLCONV I32      Perl_foldEQ_locale(const char* a, const char* b, I32 len)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 #define PERL_ARGS_ASSERT_FOLDEQ_LOCALE \
        assert(a); assert(b)
@@ -1329,6 +1333,7 @@ PERL_CALLCONV bool        Perl_isIDFIRST_lazy(pTHX_ const char* p)
                        __attribute__pure__; */
 
 PERL_STATIC_INLINE bool        S_is_c9strict_utf8_string(const U8 *s, const STRLEN len)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 #define PERL_ARGS_ASSERT_IS_C9STRICT_UTF8_STRING       \
        assert(s)
@@ -1345,6 +1350,7 @@ PERL_CALLCONV I32 Perl_is_lvalue_sub(pTHX)
                        __attribute__warn_unused_result__;
 
 PERL_STATIC_INLINE bool        S_is_strict_utf8_string(const U8 *s, const STRLEN len)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 #define PERL_ARGS_ASSERT_IS_STRICT_UTF8_STRING \
        assert(s)
@@ -1633,11 +1639,13 @@ PERL_CALLCONV bool      Perl_is_utf8_space(pTHX_ const U8 *p)
        assert(p)
 
 PERL_STATIC_INLINE bool        Perl_is_utf8_string(const U8 *s, const STRLEN len)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 #define PERL_ARGS_ASSERT_IS_UTF8_STRING        \
        assert(s)
 
 PERL_STATIC_INLINE bool        S_is_utf8_string_flags(const U8 *s, const STRLEN len, const U32 flags)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 #define PERL_ARGS_ASSERT_IS_UTF8_STRING_FLAGS  \
        assert(s)
@@ -1661,9 +1669,11 @@ PERL_CALLCONV bool       Perl_is_utf8_upper(pTHX_ const U8 *p)
        assert(p)
 
 /* PERL_CALLCONV bool  is_utf8_valid_partial_char(const U8 * const s, const U8 * const e)
+                       __attribute__warn_unused_result__
                        __attribute__pure__; */
 
 PERL_STATIC_INLINE bool        S_is_utf8_valid_partial_char_flags(const U8 * const s, const U8 * const e, const U32 flags)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 #define PERL_ARGS_ASSERT_IS_UTF8_VALID_PARTIAL_CHAR_FLAGS      \
        assert(s); assert(e)
@@ -1694,6 +1704,7 @@ PERL_CALLCONV OP* Perl_jmaybe(pTHX_ OP *o);
 #define PERL_ARGS_ASSERT_JMAYBE        \
        assert(o)
 PERL_CALLCONV I32      Perl_keyword(pTHX_ const char *name, I32 len, bool all_keywords)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 #define PERL_ARGS_ASSERT_KEYWORD       \
        assert(name)
@@ -2637,6 +2648,7 @@ PERL_CALLCONV void        Perl_require_pv(pTHX_ const char* pv);
 #define PERL_ARGS_ASSERT_REQUIRE_PV    \
        assert(pv)
 PERL_CALLCONV char*    Perl_rninstr(const char* big, const char* bigend, const char* little, const char* lend)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 #define PERL_ARGS_ASSERT_RNINSTR       \
        assert(big); assert(bigend); assert(little); assert(lend)
@@ -3088,6 +3100,7 @@ PERL_CALLCONV void        Perl_sv_free2(pTHX_ SV *const sv, const U32 refcnt);
        assert(sv)
 PERL_CALLCONV void     Perl_sv_free_arenas(pTHX);
 PERL_CALLCONV SV*      Perl_sv_get_backrefs(SV *const sv)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 #define PERL_ARGS_ASSERT_SV_GET_BACKREFS       \
        assert(sv)
@@ -3512,6 +3525,24 @@ PERL_STATIC_INLINE U8*   Perl_utf8_hop(const U8 *s, SSize_t off)
 #define PERL_ARGS_ASSERT_UTF8_HOP      \
        assert(s)
 
+PERL_STATIC_INLINE U8* Perl_utf8_hop_back(const U8 *s, SSize_t off, const U8 *start)
+                       __attribute__warn_unused_result__
+                       __attribute__pure__;
+#define PERL_ARGS_ASSERT_UTF8_HOP_BACK \
+       assert(s); assert(start)
+
+PERL_STATIC_INLINE U8* Perl_utf8_hop_forward(const U8 *s, SSize_t off, const U8 *end)
+                       __attribute__warn_unused_result__
+                       __attribute__pure__;
+#define PERL_ARGS_ASSERT_UTF8_HOP_FORWARD      \
+       assert(s); assert(end)
+
+PERL_STATIC_INLINE U8* Perl_utf8_hop_safe(const U8 *s, SSize_t off, const U8 *start, const U8 *end)
+                       __attribute__warn_unused_result__
+                       __attribute__pure__;
+#define PERL_ARGS_ASSERT_UTF8_HOP_SAFE \
+       assert(s); assert(start); assert(end)
+
 PERL_CALLCONV STRLEN   Perl_utf8_length(pTHX_ const U8* s, const U8 *e)
                        __attribute__warn_unused_result__
                        __attribute__pure__;
@@ -3687,6 +3718,7 @@ STATIC int        S_sv_2iuv_non_preserve(pTHX_ SV *const sv);
 #endif
 #if !(defined(HAS_MEMMEM))
 PERL_CALLCONV char*    Perl_ninstr(const char* big, const char* bigend, const char* little, const char* lend)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 #define PERL_ARGS_ASSERT_NINSTR        \
        assert(big); assert(bigend); assert(little); assert(lend)
@@ -3710,6 +3742,7 @@ PERL_CALLCONV void*       Perl_my_cxt_init(pTHX_ int *index, size_t size);
 #endif
 #if !(defined(WIN32))
 /* PERL_CALLCONV char* my_setlocale(pTHX_ int category, const char* locale)
+                       __attribute__warn_unused_result__
                        __attribute__pure__; */
 
 #endif
@@ -3732,6 +3765,7 @@ PERL_CALLCONV char*       Perl_getenv_len(pTHX_ const char *env_elem, unsigned long *l
 #endif
 #if !defined(HAS_MEMCMP) || !defined(HAS_SANE_MEMCMP)
 PERL_CALLCONV int      Perl_my_memcmp(const void* vs1, const void* vs2, size_t len)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 #define PERL_ARGS_ASSERT_MY_MEMCMP     \
        assert(vs1); assert(vs2)
@@ -3763,6 +3797,7 @@ PERL_CALLCONV I32 Perl_same_dirent(pTHX_ const char* a, const char* b);
 #endif
 #if !defined(HAS_SIGNBIT)
 PERL_CALLCONV int      Perl_signbit(NV f)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 
 #endif
@@ -4056,6 +4091,13 @@ STATIC void      S_print_collxfrm_input_and_return(pTHX_ const char * const s, const
        assert(s); assert(e)
 #  endif
 #endif
+#if defined(DEBUGGING) && defined(ENABLE_REGEX_SETS_DEBUGGING)
+#  if defined(PERL_IN_REGCOMP_C)
+STATIC void    S_dump_regex_sets_structures(pTHX_ RExC_state_t *pRExC_state, AV * stack, const IV fence, AV * fence_stack);
+#define PERL_ARGS_ASSERT_DUMP_REGEX_SETS_STRUCTURES    \
+       assert(pRExC_state); assert(stack); assert(fence_stack)
+#  endif
+#endif
 #if defined(DEBUG_LEAKING_SCALARS_FORK_DUMP)
 PERL_CALLCONV void     Perl_dump_sv_child(pTHX_ SV *sv);
 #define PERL_ARGS_ASSERT_DUMP_SV_CHILD \
@@ -4063,6 +4105,7 @@ PERL_CALLCONV void        Perl_dump_sv_child(pTHX_ SV *sv);
 #endif
 #if defined(HAS_MEMMEM)
 PERL_CALLCONV char*    Perl_ninstr(const char* big, const char* bigend, const char* little, const char* lend)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 #define PERL_ARGS_ASSERT_NINSTR        \
        assert(big); assert(bigend); assert(little); assert(lend)
@@ -4887,6 +4930,7 @@ PERL_STATIC_INLINE void   S_alloc_maybe_populate_EXACT(pTHX_ RExC_state_t *pRExC_s
 #define PERL_ARGS_ASSERT_ALLOC_MAYBE_POPULATE_EXACT    \
        assert(pRExC_state); assert(node); assert(flagp)
 STATIC const char *    S_cntrl_to_mnemonic(const U8 c)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 
 PERL_STATIC_INLINE U8  S_compute_EXACTish(RExC_state_t *pRExC_state);
@@ -4896,6 +4940,7 @@ STATIC regnode *  S_construct_ahocorasick_from_trie(pTHX_ RExC_state_t *pRExC_sta
 #define PERL_ARGS_ASSERT_CONSTRUCT_AHOCORASICK_FROM_TRIE       \
        assert(pRExC_state); assert(source)
 STATIC int     S_edit_distance(const UV *src, const UV *tgt, const STRLEN x, const STRLEN y, const SSize_t maxDistance)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 #define PERL_ARGS_ASSERT_EDIT_DISTANCE \
        assert(src); assert(tgt)
@@ -5008,6 +5053,7 @@ STATIC regnode*   S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 dept
 #define PERL_ARGS_ASSERT_REGCLASS      \
        assert(pRExC_state); assert(flagp)
 STATIC unsigned int    S_regex_set_precedence(const U8 my_operator)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 
 STATIC void    S_reginsert(pTHX_ RExC_state_t *pRExC_state, U8 op, regnode *opnd, U32 depth);
@@ -5277,10 +5323,13 @@ STATIC I32      S_reg_check_named_buff_matched(const regexp *rex, const regnode *scan
 #define PERL_ARGS_ASSERT_REG_CHECK_NAMED_BUFF_MATCHED  \
        assert(rex); assert(scan)
 
-STATIC void    S_regcppop(pTHX_ regexp *rex, U32 *maxopenparen_p);
+STATIC void    S_regcp_restore(pTHX_ regexp *rex, I32 ix, U32 *maxopenparen_p _pDEPTH);
+#define PERL_ARGS_ASSERT_REGCP_RESTORE \
+       assert(rex); assert(maxopenparen_p)
+STATIC void    S_regcppop(pTHX_ regexp *rex, U32 *maxopenparen_p _pDEPTH);
 #define PERL_ARGS_ASSERT_REGCPPOP      \
        assert(rex); assert(maxopenparen_p)
-STATIC CHECKPOINT      S_regcppush(pTHX_ const regexp *rex, I32 parenfloor, U32 maxopenparen);
+STATIC CHECKPOINT      S_regcppush(pTHX_ const regexp *rex, I32 parenfloor, U32 maxopenparen _pDEPTH);
 #define PERL_ARGS_ASSERT_REGCPPUSH     \
        assert(rex)
 STATIC U8*     S_reghop3(U8 *s, SSize_t off, const U8 *lim)
@@ -5308,7 +5357,7 @@ STATIC SSize_t    S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode
 #define PERL_ARGS_ASSERT_REGMATCH      \
        assert(reginfo); assert(startpos); assert(prog)
 
-STATIC I32     S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p, regmatch_info *const reginfo, I32 max, int depth)
+STATIC I32     S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p, regmatch_info *const reginfo, I32 max _pDEPTH)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_REGREPEAT     \
        assert(prog); assert(startposp); assert(p); assert(reginfo)
@@ -5478,7 +5527,7 @@ STATIC int        S_intuit_method(pTHX_ char *s, SV *ioname, CV *cv);
 STATIC int     S_intuit_more(pTHX_ char *s);
 #define PERL_ARGS_ASSERT_INTUIT_MORE   \
        assert(s)
-STATIC I32     S_lop(pTHX_ I32 f, int x, char *s);
+STATIC I32     S_lop(pTHX_ I32 f, U8 x, char *s);
 #define PERL_ARGS_ASSERT_LOP   \
        assert(s)
 PERL_STATIC_NO_RET void        S_missingterm(pTHX_ char *s)
@@ -5595,6 +5644,12 @@ PERL_STATIC_INLINE bool  S_does_utf8_overflow(const U8 * const s, const U8 * e)
 #define PERL_ARGS_ASSERT_DOES_UTF8_OVERFLOW    \
        assert(s); assert(e)
 
+PERL_STATIC_INLINE bool        S_isFF_OVERLONG(const U8 * const s, const STRLEN len)
+                       __attribute__warn_unused_result__
+                       __attribute__pure__;
+#define PERL_ARGS_ASSERT_ISFF_OVERLONG \
+       assert(s)
+
 PERL_STATIC_INLINE bool        S_is_utf8_common(pTHX_ const U8 *const p, SV **swash, const char * const swashname, SV* const invlist)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_IS_UTF8_COMMON        \
@@ -5625,7 +5680,7 @@ STATIC SV*        S_swatch_get(pTHX_ SV* swash, UV start, UV span)
 STATIC U8      S_to_lower_latin1(const U8 c, U8 *p, STRLEN *lenp)
                        __attribute__warn_unused_result__;
 
-STATIC char *  S_unexpected_non_continuation_text(pTHX_ const U8 * const s, const STRLEN print_len, const STRLEN non_cont_byte_pos, const STRLEN expect_len)
+STATIC char *  S_unexpected_non_continuation_text(pTHX_ const U8 * const s, STRLEN print_len, const STRLEN non_cont_byte_pos, const STRLEN expect_len)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_UNEXPECTED_NON_CONTINUATION_TEXT      \
        assert(s)
@@ -5884,6 +5939,7 @@ PERL_CALLCONV const char* Perl_quadmath_format_single(const char* format);
 #endif
 #if defined(WIN32)
 PERL_CALLCONV char*    Perl_my_setlocale(pTHX_ int category, const char* locale)
+                       __attribute__warn_unused_result__
                        __attribute__pure__;
 
 PERL_CALLCONV_NO_RET void      win32_croak_not_implemented(const char * fname)