From a1894d81735066945ef520af52cc180d1e0dfb10 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 6 Dec 2012 22:42:18 -0700 Subject: [PATCH] Silence some g++ compiler warnings Changing these slightly got rid of the warnings like: toke.c:9168: warning: format not a string literal and no format arguments --- doio.c | 2 +- pp.c | 4 ++-- pp_ctl.c | 4 ++-- toke.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doio.c b/doio.c index e915bd5..08ed433 100644 --- a/doio.c +++ b/doio.c @@ -1333,7 +1333,7 @@ I32 Perl_my_lstat_flags(pTHX_ const U32 flags) { dVAR; - static const char no_prev_lstat[] = "The stat preceding -l _ wasn't an lstat"; + static const char* const no_prev_lstat = "The stat preceding -l _ wasn't an lstat"; dSP; const char *file; if (PL_op->op_flags & OPf_REF) { diff --git a/pp.c b/pp.c index cf59a84..2eb5bc1 100644 --- a/pp.c +++ b/pp.c @@ -1646,7 +1646,7 @@ PP(pp_repeat) if (GIMME == G_ARRAY && PL_op->op_private & OPpREPEAT_DOLIST) { dMARK; - static const char oom_list_extend[] = "Out of memory during list extend"; + static const char* const oom_list_extend = "Out of memory during list extend"; const I32 items = SP - MARK; const I32 max = items * count; @@ -1698,7 +1698,7 @@ PP(pp_repeat) SV * const tmpstr = POPs; STRLEN len; bool isutf; - static const char oom_string_extend[] = + static const char* const oom_string_extend = "Out of memory during string extend"; if (TARG != tmpstr) diff --git a/pp_ctl.c b/pp_ctl.c index 0256070..cd5033f 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -2692,7 +2692,7 @@ S_dofindlabel(pTHX_ OP *o, const char *label, STRLEN len, U32 flags, OP **opstac { dVAR; OP **ops = opstack; - static const char too_deep[] = "Target of goto is too deeply nested"; + static const char* const too_deep = "Target of goto is too deeply nested"; PERL_ARGS_ASSERT_DOFINDLABEL; @@ -2764,7 +2764,7 @@ PP(pp_goto) STRLEN label_len = 0; U32 label_flags = 0; const bool do_dump = (PL_op->op_type == OP_DUMP); - static const char must_have_label[] = "goto must have label"; + static const char* const must_have_label = "goto must have label"; if (PL_op->op_flags & OPf_STACKED) { SV * const sv = POPs; diff --git a/toke.c b/toke.c index 16f359e..628a5da 100644 --- a/toke.c +++ b/toke.c @@ -110,7 +110,7 @@ Individual members of C have their own documentation. # define PL_nextval (PL_parser->nextval) #endif -static const char ident_too_long[] = "Identifier too long"; +static const char* const ident_too_long = "Identifier too long"; #ifdef PERL_MAD # define CURMAD(slot,sv) if (PL_madskills) { curmad(slot,sv); sv = 0; } @@ -10646,7 +10646,7 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp) SV *sv = NULL; /* place to put the converted number */ bool floatit; /* boolean: int or float? */ const char *lastub = NULL; /* position of last underbar */ - static char const number_too_long[] = "Number too long"; + static const char* const number_too_long = "Number too long"; PERL_ARGS_ASSERT_SCAN_NUM; -- 2.7.4