diff options
author | David Mitchell <davem@iabyn.com> | 2012-12-04 13:22:41 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2012-12-04 13:39:55 +0000 |
commit | ccde85316a0db149f30359ebfdf031ef602b0344 (patch) | |
tree | 5f9accee8d15f9bd5574b53db1b871cc6bf945a4 | |
parent | c434e88d3bead3f9417903defe6f23a1ad0ca522 (diff) | |
download | perl-ccde85316a0db149f30359ebfdf031ef602b0344.tar.gz |
silence some clang warnings
principally, proto.h was sometimes being included twice - once before
a fn decl, and once after - giving rise to a 'decl after def' warning.
Also, S_croak_memory_wrap was declared static in every source file, but
not used in some. So selectively disable the unused-function warning.
-rw-r--r-- | dquote_static.c | 1 | ||||
-rw-r--r-- | dump.c | 1 | ||||
-rw-r--r-- | embed.fnc | 4 | ||||
-rw-r--r-- | embed.h | 12 | ||||
-rw-r--r-- | inline.h | 3 | ||||
-rw-r--r-- | proto.h | 60 |
6 files changed, 41 insertions, 40 deletions
diff --git a/dquote_static.c b/dquote_static.c index a3f950f7e1..868cd06b7d 100644 --- a/dquote_static.c +++ b/dquote_static.c @@ -8,7 +8,6 @@ */ #define PERL_IN_DQUOTE_STATIC_C -#include "proto.h" #include "embed.h" /* @@ -26,7 +26,6 @@ #define PERL_IN_DUMP_C #include "perl.h" #include "regcomp.h" -#include "proto.h" static const char* const svtypenames[SVt_LAST] = { @@ -715,7 +715,7 @@ Ap |void |vload_module|U32 flags|NN SV* name|NULLOK SV* ver|NULLOK va_list* args p |OP* |localize |NN OP *o|I32 lex ApdR |I32 |looks_like_number|NN SV *const sv Apd |UV |grok_bin |NN const char* start|NN STRLEN* len_p|NN I32* flags|NULLOK NV *result -#ifdef PERL_IN_DQUOTE_STATIC_C +#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C) EMsR |char |grok_bslash_c |const char source|const bool utf8|const bool output_warning EMsR |bool |grok_bslash_o |NN const char* s|NN UV* uv|NN STRLEN* len|NN const char** error_msg|const bool output_warning EMiR |bool |grok_bslash_x |NN const char* s|NN UV* uv|NN STRLEN* len|NN const char** error_msg|const bool output_warning @@ -1072,7 +1072,7 @@ Ap |char* |re_intuit_start|NN REGEXP * const rx|NULLOK SV* sv|NN char* strpos \ |NN char* strend|const U32 flags \ |NULLOK re_scream_pos_data *data Ap |SV* |re_intuit_string|NN REGEXP *const r -#if defined(PERL_IN_DQUOTE_STATIC_C) +#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C) EiPR |I32 |regcurly |NN const char *s #endif Ap |I32 |regexec_flags |NN REGEXP *const rx|NN char *stringarg \ @@ -883,12 +883,6 @@ # if defined(PERL_ANY_COW) #define sv_setsv_cow(a,b) Perl_sv_setsv_cow(aTHX_ a,b) # endif -# if defined(PERL_IN_DQUOTE_STATIC_C) -#define grok_bslash_c(a,b,c) S_grok_bslash_c(aTHX_ a,b,c) -#define grok_bslash_o(a,b,c,d,e) S_grok_bslash_o(aTHX_ a,b,c,d,e) -#define grok_bslash_x(a,b,c,d,e) S_grok_bslash_x(aTHX_ a,b,c,d,e) -#define regcurly(a) S_regcurly(aTHX_ a) -# endif # if defined(PERL_IN_REGCOMP_C) #define _append_range_to_invlist(a,b,c) S__append_range_to_invlist(aTHX_ a,b,c) #define _invlist_array_init(a,b) S__invlist_array_init(aTHX_ a,b) @@ -952,6 +946,12 @@ # if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_UTF8_C) || defined(PERL_IN_TOKE_C) #define _core_swash_init(a,b,c,d,e,f,g) Perl__core_swash_init(aTHX_ a,b,c,d,e,f,g) # endif +# if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C) +#define grok_bslash_c(a,b,c) S_grok_bslash_c(aTHX_ a,b,c) +#define grok_bslash_o(a,b,c,d,e) S_grok_bslash_o(aTHX_ a,b,c,d,e) +#define grok_bslash_x(a,b,c,d,e) S_grok_bslash_x(aTHX_ a,b,c,d,e) +#define regcurly(a) S_regcurly(aTHX_ a) +# endif # if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_UTF8_C) #define _add_range_to_invlist(a,b,c) Perl__add_range_to_invlist(aTHX_ a,b,c) #define _invlist_intersection_maybe_complement_2nd(a,b,c,d) Perl__invlist_intersection_maybe_complement_2nd(aTHX_ a,b,c,d) @@ -126,8 +126,11 @@ S_sv_or_pv_pos_u2b(pTHX_ SV *sv, const char *pv, STRLEN pos, STRLEN *lenp) /* ------------------------------- handy.h ------------------------------- */ /* saves machine code for a common noreturn idiom typically used in Newx*() */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-function" static void S_croak_memory_wrap(void) { Perl_croak_nocontext("%s",PL_memory_wrap); } +#pragma clang diagnostic pop @@ -5513,36 +5513,6 @@ STATIC I32 S_do_trans_simple_utf8(pTHX_ SV * const sv) assert(sv) #endif -#if defined(PERL_IN_DQUOTE_STATIC_C) -STATIC char S_grok_bslash_c(pTHX_ const char source, const bool utf8, const bool output_warning) - __attribute__warn_unused_result__; - -STATIC bool S_grok_bslash_o(pTHX_ const char* s, UV* uv, STRLEN* len, const char** error_msg, const bool output_warning) - __attribute__warn_unused_result__ - __attribute__nonnull__(pTHX_1) - __attribute__nonnull__(pTHX_2) - __attribute__nonnull__(pTHX_3) - __attribute__nonnull__(pTHX_4); -#define PERL_ARGS_ASSERT_GROK_BSLASH_O \ - assert(s); assert(uv); assert(len); assert(error_msg) - -PERL_STATIC_INLINE bool S_grok_bslash_x(pTHX_ const char* s, UV* uv, STRLEN* len, const char** error_msg, const bool output_warning) - __attribute__warn_unused_result__ - __attribute__nonnull__(pTHX_1) - __attribute__nonnull__(pTHX_2) - __attribute__nonnull__(pTHX_3) - __attribute__nonnull__(pTHX_4); -#define PERL_ARGS_ASSERT_GROK_BSLASH_X \ - assert(s); assert(uv); assert(len); assert(error_msg) - -PERL_STATIC_INLINE I32 S_regcurly(pTHX_ const char *s) - __attribute__warn_unused_result__ - __attribute__pure__ - __attribute__nonnull__(pTHX_1); -#define PERL_ARGS_ASSERT_REGCURLY \ - assert(s) - -#endif #if defined(PERL_IN_DUMP_C) STATIC CV* S_deb_curcv(pTHX_ const I32 ix); STATIC void S_debprof(pTHX_ const OP *o) @@ -6683,6 +6653,36 @@ PERL_CALLCONV SV* Perl__core_swash_init(pTHX_ const char* pkg, const char* name, assert(pkg); assert(name); assert(listsv) #endif +#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C) +STATIC char S_grok_bslash_c(pTHX_ const char source, const bool utf8, const bool output_warning) + __attribute__warn_unused_result__; + +STATIC bool S_grok_bslash_o(pTHX_ const char* s, UV* uv, STRLEN* len, const char** error_msg, const bool output_warning) + __attribute__warn_unused_result__ + __attribute__nonnull__(pTHX_1) + __attribute__nonnull__(pTHX_2) + __attribute__nonnull__(pTHX_3) + __attribute__nonnull__(pTHX_4); +#define PERL_ARGS_ASSERT_GROK_BSLASH_O \ + assert(s); assert(uv); assert(len); assert(error_msg) + +PERL_STATIC_INLINE bool S_grok_bslash_x(pTHX_ const char* s, UV* uv, STRLEN* len, const char** error_msg, const bool output_warning) + __attribute__warn_unused_result__ + __attribute__nonnull__(pTHX_1) + __attribute__nonnull__(pTHX_2) + __attribute__nonnull__(pTHX_3) + __attribute__nonnull__(pTHX_4); +#define PERL_ARGS_ASSERT_GROK_BSLASH_X \ + assert(s); assert(uv); assert(len); assert(error_msg) + +PERL_STATIC_INLINE I32 S_regcurly(pTHX_ const char *s) + __attribute__warn_unused_result__ + __attribute__pure__ + __attribute__nonnull__(pTHX_1); +#define PERL_ARGS_ASSERT_REGCURLY \ + assert(s) + +#endif #if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_UTF8_C) PERL_CALLCONV SV* Perl__add_range_to_invlist(pTHX_ SV* invlist, const UV start, const UV end) __attribute__warn_unused_result__; |