From: Steve Peters Date: Sat, 19 Nov 2005 18:06:14 +0000 (+0000) Subject: Cleaning up some warnings generated by "gcc -W" X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=65e66c80cefadd5e860e8232c69fd1a11e6c5b92;p=p5sagit%2Fp5-mst-13.2.git Cleaning up some warnings generated by "gcc -W" p4raw-id: //depot/perl@26175 --- diff --git a/deb.c b/deb.c index a3b67b4..23c16dc 100644 --- a/deb.c +++ b/deb.c @@ -44,6 +44,8 @@ Perl_deb(pTHX_ const char *pat, ...) va_start(args, pat); vdeb(pat, &args); va_end(args); +#else + PERL_UNUSED_ARG(pat); #endif /* DEBUGGING */ } @@ -56,6 +58,9 @@ Perl_vdeb(pTHX_ const char *pat, va_list *args) PerlIO_printf(Perl_debug_log, "(%s:%ld)\t", (file ? file : ""), (long)CopLINE(PL_curcop)); (void) PerlIO_vprintf(Perl_debug_log, pat, *args); +#else + PERL_UNUSED_ARG(pat); + PERL_UNUSED_ARG(args); #endif /* DEBUGGING */ } @@ -122,6 +127,12 @@ S_deb_stack_n(pTHX_ SV** stack_base, I32 stack_min, I32 stack_max, } while (1); PerlIO_printf(Perl_debug_log, "\n"); +#else + PERL_UNUSED_ARG(stack_base); + PERL_UNUSED_ARG(stack_min); + PERL_UNUSED_ARG(stack_max); + PERL_UNUSED_ARG(mark_min); + PERL_UNUSED_ARG(mark_max); #endif /* DEBUGGING */ } diff --git a/ext/B/B.xs b/ext/B/B.xs index 953f6be..6b3d64c 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -1322,6 +1322,7 @@ precomp(mg) B::MAGIC mg CODE: if (mg->mg_type == 'r') { + RETVAL = Nullsv; REGEXP* rx = (REGEXP*)mg->mg_obj; if( rx ) RETVAL = newSVpvn( rx->precomp, rx->prelen ); diff --git a/ext/Data/Dumper/Dumper.xs b/ext/Data/Dumper/Dumper.xs index 2552391..e6940a3 100644 --- a/ext/Data/Dumper/Dumper.xs +++ b/ext/Data/Dumper/Dumper.xs @@ -212,8 +212,10 @@ sv_x(pTHX_ SV *sv, const char *str, STRLEN len, I32 n) { if (sv == Nullsv) sv = newSVpvn("", 0); +#ifdef DEBUGGING else assert(SvTYPE(sv) >= SVt_PV); +#endif if (n > 0) { SvGROW(sv, len*n + SvCUR(sv) + 1); @@ -966,7 +968,7 @@ Data_Dumper_Dumpxs(href, ...) todumpav = namesav = Nullav; seenhv = Nullhv; val = pad = xpad = apad = sep = pair = varname - = freezer = toaster = bless = &PL_sv_undef; + = freezer = toaster = bless = sortkeys = &PL_sv_undef; name = sv_newmortal(); indent = 2; terse = purity = deepcopy = 0; diff --git a/ext/PerlIO/encoding/encoding.xs b/ext/PerlIO/encoding/encoding.xs index d4b47cf..362d66c 100644 --- a/ext/PerlIO/encoding/encoding.xs +++ b/ext/PerlIO/encoding/encoding.xs @@ -255,7 +255,7 @@ PerlIOEncode_fill(pTHX_ PerlIO * f) STDCHAR *ptr = PerlIO_get_ptr(n); SSize_t use = (avail >= 0) ? avail : 0; SV *uni; - char *s; + char *s = Nullch; STRLEN len = 0; e->base.ptr = e->base.end = (STDCHAR *) Nullch; (void) PerlIOEncode_get_base(aTHX_ f); diff --git a/mg.c b/mg.c index 1423df0..a475721 100644 --- a/mg.c +++ b/mg.c @@ -1121,6 +1121,7 @@ Perl_magic_clearenv(pTHX_ SV *sv, MAGIC *mg) int Perl_magic_set_all_env(pTHX_ SV *sv, MAGIC *mg) { + PERL_UNUSED_ARG(mg); #if defined(VMS) Perl_die(aTHX_ "Can't make list assignment to %%ENV on this system"); #else diff --git a/op.c b/op.c index d9cb1d0..aeedab9 100644 --- a/op.c +++ b/op.c @@ -4628,9 +4628,10 @@ Perl_newCONSTSUB(pTHX_ HV *stash, const char *name, SV *sv) CvCONST_on(cv); sv_setpvn((SV*)cv, "", 0); /* prototype is "" */ +#ifdef USE_ITHREADS if (stash) CopSTASH_free(PL_curcop); - +#endif LEAVE; return cv; diff --git a/regcomp.c b/regcomp.c index dd2188f..7d5d8a3 100644 --- a/regcomp.c +++ b/regcomp.c @@ -5757,6 +5757,8 @@ Perl_regdump(pTHX_ regexp *r) PerlIO_printf(Perl_debug_log, "\n"); }); } +#else + PERL_UNUSED_ARG(r); #endif /* DEBUGGING */ } @@ -5956,6 +5958,9 @@ Perl_regprop(pTHX_ SV *sv, const regnode *o) } else if (k == BRANCHJ && (OP(o) == UNLESSM || OP(o) == IFMATCH)) Perl_sv_catpvf(aTHX_ sv, "[-%d]", o->flags); +#else + PERL_UNUSED_ARG(sv); + PERL_UNUSED_ARG(o); #endif /* DEBUGGING */ } diff --git a/scope.c b/scope.c index 6b710c6..4806316 100644 --- a/scope.c +++ b/scope.c @@ -1091,6 +1091,8 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx) PTR2UV(cx->sb_rxres)); break; } +#else + PERL_UNUSED_ARG(cx); #endif /* DEBUGGING */ }