diff options
author | Karl Williamson <khw@cpan.org> | 2019-11-16 16:13:57 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2019-11-21 18:19:46 -0700 |
commit | 1bb4bd13bebef37d6623688a00287d54356f6dfc (patch) | |
tree | c51c7fa7c66d696484380f4565d1d7fcd6ac4762 | |
parent | 8cd2df90afad606059f373d58f46f8729709a6f2 (diff) | |
download | perl-1bb4bd13bebef37d6623688a00287d54356f6dfc.tar.gz |
PATCH: gh #17275 Silence new warning
This was caused by a static inline function in a header that was
#included in a file that didn't use it. Normally, these functions are
#ifdef'd so as to be visible only to files in which they are used.
Some compilers warn that the function is defined but not used
otherwise. The solution is to remove this function's visibility from
the file that didn't use it.
-rw-r--r-- | embed.fnc | 2 | ||||
-rw-r--r-- | embed.h | 10 | ||||
-rw-r--r-- | invlist_inline.h | 3 | ||||
-rw-r--r-- | proto.h | 40 |
4 files changed, 32 insertions, 23 deletions
@@ -1878,6 +1878,8 @@ EiR |SV* |add_cp_to_invlist |NULLOK SV* invlist|const UV cp Ei |void |invlist_extend |NN SV* const invlist|const UV len Ei |void |invlist_set_len|NN SV* const invlist|const UV len|const bool offset EiRT |UV |invlist_highest|NN SV* const invlist +#endif +#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_OP_C) EiRT |STRLEN*|get_invlist_iter_addr |NN SV* invlist EiT |void |invlist_iterinit|NN SV* invlist EiRT |bool |invlist_iternext|NN SV* invlist|NN UV* start|NN UV* end @@ -1074,14 +1074,16 @@ # if defined(PERL_IN_REGCOMP_C) || defined (PERL_IN_DUMP_C) || defined(PERL_IN_OP_C) #define _invlist_dump(a,b,c,d) Perl__invlist_dump(aTHX_ a,b,c,d) # endif -# if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_OP_C) || defined(PERL_IN_DOOP_C) -#define add_cp_to_invlist(a,b) S_add_cp_to_invlist(aTHX_ a,b) +# if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_OP_C) #define get_invlist_iter_addr S_get_invlist_iter_addr -#define invlist_extend(a,b) S_invlist_extend(aTHX_ a,b) -#define invlist_highest S_invlist_highest #define invlist_iterfinish S_invlist_iterfinish #define invlist_iterinit S_invlist_iterinit #define invlist_iternext S_invlist_iternext +# endif +# if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_OP_C) || defined(PERL_IN_DOOP_C) +#define add_cp_to_invlist(a,b) S_add_cp_to_invlist(aTHX_ a,b) +#define invlist_extend(a,b) S_invlist_extend(aTHX_ a,b) +#define invlist_highest S_invlist_highest #define invlist_set_len(a,b,c) S_invlist_set_len(aTHX_ a,b,c) # endif # if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_PERL_C) || defined(PERL_IN_UTF8_C) diff --git a/invlist_inline.h b/invlist_inline.h index 33f8aee385..f6ac819533 100644 --- a/invlist_inline.h +++ b/invlist_inline.h @@ -161,6 +161,9 @@ S_invlist_highest(SV* const invlist) : array[len - 1] - 1; } +#endif +#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_OP_C) + PERL_STATIC_INLINE STRLEN* S_get_invlist_iter_addr(SV* invlist) { @@ -5767,13 +5767,7 @@ PERL_CALLCONV void Perl__invlist_dump(pTHX_ PerlIO *file, I32 level, const char* #define PERL_ARGS_ASSERT__INVLIST_DUMP \ assert(file); assert(indent); assert(invlist) #endif -#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_OP_C) || defined(PERL_IN_DOOP_C) -#ifndef PERL_NO_INLINE_FUNCTIONS -PERL_STATIC_INLINE SV* S_add_cp_to_invlist(pTHX_ SV* invlist, const UV cp) - __attribute__warn_unused_result__; -#define PERL_ARGS_ASSERT_ADD_CP_TO_INVLIST -#endif - +#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_OP_C) #ifndef PERL_NO_INLINE_FUNCTIONS PERL_STATIC_INLINE STRLEN* S_get_invlist_iter_addr(SV* invlist) __attribute__warn_unused_result__; @@ -5782,18 +5776,6 @@ PERL_STATIC_INLINE STRLEN* S_get_invlist_iter_addr(SV* invlist) #endif #ifndef PERL_NO_INLINE_FUNCTIONS -PERL_STATIC_INLINE void S_invlist_extend(pTHX_ SV* const invlist, const UV len); -#define PERL_ARGS_ASSERT_INVLIST_EXTEND \ - assert(invlist) -#endif -#ifndef PERL_NO_INLINE_FUNCTIONS -PERL_STATIC_INLINE UV S_invlist_highest(SV* const invlist) - __attribute__warn_unused_result__; -#define PERL_ARGS_ASSERT_INVLIST_HIGHEST \ - assert(invlist) -#endif - -#ifndef PERL_NO_INLINE_FUNCTIONS PERL_STATIC_INLINE void S_invlist_iterfinish(SV* invlist); #define PERL_ARGS_ASSERT_INVLIST_ITERFINISH \ assert(invlist) @@ -5810,6 +5792,26 @@ PERL_STATIC_INLINE bool S_invlist_iternext(SV* invlist, UV* start, UV* end) assert(invlist); assert(start); assert(end) #endif +#endif +#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_OP_C) || defined(PERL_IN_DOOP_C) +#ifndef PERL_NO_INLINE_FUNCTIONS +PERL_STATIC_INLINE SV* S_add_cp_to_invlist(pTHX_ SV* invlist, const UV cp) + __attribute__warn_unused_result__; +#define PERL_ARGS_ASSERT_ADD_CP_TO_INVLIST +#endif + +#ifndef PERL_NO_INLINE_FUNCTIONS +PERL_STATIC_INLINE void S_invlist_extend(pTHX_ SV* const invlist, const UV len); +#define PERL_ARGS_ASSERT_INVLIST_EXTEND \ + assert(invlist) +#endif +#ifndef PERL_NO_INLINE_FUNCTIONS +PERL_STATIC_INLINE UV S_invlist_highest(SV* const invlist) + __attribute__warn_unused_result__; +#define PERL_ARGS_ASSERT_INVLIST_HIGHEST \ + assert(invlist) +#endif + #ifndef PERL_NO_INLINE_FUNCTIONS PERL_STATIC_INLINE void S_invlist_set_len(pTHX_ SV* const invlist, const UV len, const bool offset); #define PERL_ARGS_ASSERT_INVLIST_SET_LEN \ |