ywarn() is actually only used inside toke.c, so it can be static.
Nicholas Clark [Wed, 26 Nov 2008 23:35:59 +0000 (23:35 +0000)]
p4raw-id: //depot/perl@34941

embed.fnc
embed.h
proto.h
toke.c

index 0edc28a..89bc271 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1054,7 +1054,9 @@ p |int    |yyerror        |NN const char *const s
 EXp    |int    |yylex
 p      |int    |yyparse
 p      |void   |parser_free    |NN const yy_parser *parser
-p      |int    |yywarn         |NN const char *const s
+#if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT)
+s      |int    |yywarn         |NN const char *const s
+#endif
 #if defined(MYMALLOC)
 Ap     |void   |dump_mstats    |NN const char* s
 Ap     |int    |get_mstats     |NN perl_mstats_t *buf|int buflen|int level
diff --git a/embed.h b/embed.h
index 2ac8d07..9b31ff7 100644 (file)
--- a/embed.h
+++ b/embed.h
 #ifdef PERL_CORE
 #define yyparse                        Perl_yyparse
 #define parser_free            Perl_parser_free
-#define yywarn                 Perl_yywarn
+#endif
+#if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
+#define yywarn                 S_yywarn
+#endif
 #endif
 #if defined(MYMALLOC)
 #define dump_mstats            Perl_dump_mstats
 #ifdef PERL_CORE
 #define yyparse()              Perl_yyparse(aTHX)
 #define parser_free(a)         Perl_parser_free(aTHX_ a)
-#define yywarn(a)              Perl_yywarn(aTHX_ a)
+#endif
+#if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
+#define yywarn(a)              S_yywarn(aTHX_ a)
+#endif
 #endif
 #if defined(MYMALLOC)
 #define dump_mstats(a)         Perl_dump_mstats(aTHX_ a)
diff --git a/proto.h b/proto.h
index 0ce5a27..91dde2e 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -3733,11 +3733,13 @@ PERL_CALLCONV void      Perl_parser_free(pTHX_ const yy_parser *parser)
 #define PERL_ARGS_ASSERT_PARSER_FREE   \
        assert(parser)
 
-PERL_CALLCONV int      Perl_yywarn(pTHX_ const char *const s)
+#if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT)
+STATIC int     S_yywarn(pTHX_ const char *const s)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_YYWARN        \
        assert(s)
 
+#endif
 #if defined(MYMALLOC)
 PERL_CALLCONV void     Perl_dump_mstats(pTHX_ const char* s)
                        __attribute__nonnull__(pTHX_1);
diff --git a/toke.c b/toke.c
index d8cd2e5..580ca91 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -12575,8 +12575,8 @@ Perl_start_subparse(pTHX_ I32 is_format, U32 flags)
 #ifdef __SC__
 #pragma segment Perl_yylex
 #endif
-int
-Perl_yywarn(pTHX_ const char *const s)
+static int
+S_yywarn(pTHX_ const char *const s)
 {
     dVAR;