diff --git a/locale.c b/locale.c index 4992f5e937ad..5773f9ebd48c 100644 --- a/locale.c +++ b/locale.c @@ -1474,7 +1474,9 @@ S_parse_LC_ALL_string(pTHX_ const char * string, } } - const char * msg; + /* Some compilers don't realize all paths initialize this */ + const char * msg = NULL; + const char * display_start = s; const char * display_end = e; diff --git a/mg.c b/mg.c index 4dad61f3e41c..08c8e23ebd32 100644 --- a/mg.c +++ b/mg.c @@ -3803,6 +3803,7 @@ Perl_perly_sighandler(int sig, Siginfo_t *sip PERL_UNUSED_DECL, /* Not clear if this will work */ /* XXX not clear if this should be protected by 'if (safe)' * too */ + PERL_UNUSED_ARG(safe); (void)rsignal(sig, SIG_IGN); (void)rsignal(sig, PL_csighandlerp); diff --git a/perl.c b/perl.c index 12117d04e5f1..1881ffc51739 100644 --- a/perl.c +++ b/perl.c @@ -4406,7 +4406,9 @@ S_init_ids(pTHX) bool Perl_doing_taint(int argc, char *argv[], char *envp[]) { -#ifndef PERL_IMPLICIT_SYS +#ifdef PERL_IMPLICIT_SYS + PERL_UNUSED_ARG(envp); +#else /* If we have PERL_IMPLICIT_SYS we can't call getuid() et alia * before we have an interpreter-- and the whole point of this * function is to be called at such an early stage. If you are on diff --git a/pp_hot.c b/pp_hot.c index e95553463f7d..89e0c8cbf9e2 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -359,7 +359,7 @@ PP(pp_aelemfastlex_store) /* inlined av_fetch() for simple cases ... */ if (!SvRMAGICAL(av) && key >=0 && key <= AvFILLp(av)) { - targ = AvARRAY(av)[key]; + targ = AvARRAY(av)[ (U8) key ]; } /* ... else do it the hard way */ if (!targ) { @@ -1590,7 +1590,7 @@ PP(pp_readline) SvGETMAGIC(arg); /* unrolled tryAMAGICunTARGETlist(iter_amg, 0) */ - SV *tmpsv; + SV *tmpsv = NULL; U8 gimme = GIMME_V; if (UNLIKELY(SvAMAGIC(arg) && (tmpsv = amagic_call(arg, &PL_sv_undef, iter_amg, @@ -2033,7 +2033,7 @@ PP(pp_aelemfast) /* inlined av_fetch() for simple cases ... */ if (!SvRMAGICAL(av) && key >= 0 && key <= AvFILLp(av)) { - sv = AvARRAY(av)[key]; + sv = AvARRAY(av)[ (U8) key ]; if (sv) goto ret; if (!lval) { diff --git a/pp_sys.c b/pp_sys.c index 9a47afd82bc3..4e542c6c1ca7 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -392,7 +392,7 @@ PP(pp_glob) /* unrolled tryAMAGICunTARGETlist(iter_amg, (PL_op->op_flags & OPf_SPECIAL)); */ - SV *tmpsv; + SV *tmpsv = NULL; U8 gimme = GIMME_V; if (UNLIKELY(SvAMAGIC(arg) && (tmpsv = amagic_call(arg, &PL_sv_undef, iter_amg, @@ -5558,6 +5558,7 @@ PP_wrapped(pp_shostent, 1, 0) { dSP; const int stayopen = TOPi; + PERL_UNUSED_VAR(stayopen); switch(PL_op->op_type) { case OP_SHOSTENT: #ifdef HAS_SETHOSTENT diff --git a/toke.c b/toke.c index ece6bb56d5e5..af34fd672211 100644 --- a/toke.c +++ b/toke.c @@ -12458,7 +12458,7 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp) const char *lastub = NULL; /* position of last underbar */ static const char* const number_too_long = "Number too long"; bool warned_about_underscore = 0; - I32 shift; /* shift per digit for hex/oct/bin, hoisted here for fp */ + I32 shift = 0; /* shift per digit for hex/oct/bin, hoisted here for fp */ #define WARN_ABOUT_UNDERSCORE() \ do { \ if (!warned_about_underscore) { \ diff --git a/util.c b/util.c index eddba602d12a..7d037f65ee11 100644 --- a/util.c +++ b/util.c @@ -2940,6 +2940,7 @@ Perl_rsignal(pTHX_ int signo, Sighandler_t handler) static Signal_t sig_trap(int signo) { + PERL_UNUSED_ARG(signo); PL_sig_trapped++; } diff --git a/win32/fcrypt.c b/win32/fcrypt.c index f2836eddd250..88a23f341d11 100644 --- a/win32/fcrypt.c +++ b/win32/fcrypt.c @@ -2,6 +2,8 @@ /* Copyright (C) 1993 Eric Young - see README for more details */ #include #include +#include "EXTERN.h" +#include "perl.h" /* Eric Young. * This version of crypt has been developed from my MIT compatible @@ -466,12 +468,10 @@ unsigned const char cov_2char[64]={ }; /* the salt for classic DES crypt (which is all we implement here) - permits [./0-9A-Za-z], since '.' and '/' immediately precede - '0' we don't need individual checks for '.' and '/' + permits [./0-9A-Za-z], since '.' and '/' are adjacent, we don't need + individual checks for them */ -#define good_for_salt(c) \ - ((c) >= '.' && (c) <= '9' || (c) >= 'A' && (c) <= 'Z' || \ - (c) >= 'a' && (c) <= 'z') +#define good_for_salt(c) (isALPHANUMERIC(c) || inRANGE((c), '.', '/')) char * des_fcrypt(const char *buf, const char *salt, char *buff) diff --git a/win32/perllib.c b/win32/perllib.c index efae2d817b8d..15cef6ebb731 100644 --- a/win32/perllib.c +++ b/win32/perllib.c @@ -261,7 +261,7 @@ EXTERN_C /* GCC in C++ mode mangles the name, otherwise */ BOOL APIENTRY DllMain(HINSTANCE hModule, /* DLL module handle */ DWORD fdwReason, /* reason called */ - LPVOID lpvReserved) /* reserved */ + LPVOID) /* reserved */ { switch (fdwReason) { /* The DLL is attaching to a process due to process diff --git a/win32/vmem.h b/win32/vmem.h index 3d5492958756..e59096d9bf21 100644 --- a/win32/vmem.h +++ b/win32/vmem.h @@ -61,28 +61,33 @@ inline void MEMODSlx(char *str, long x) Even though perl links with ucrtbase.dll, there is alot of overhead for using ::new() operator. Just implement our own ::new(), more C-style. */ #define VMEM_H_NEW_OP \ - void* operator new(size_t size) noexcept { \ - void * p = (void*)win32_malloc(size); \ - if(!p) noperl_die("%s%s","Out of memory in perl:", "???"); return p; }; \ - void* operator new[](size_t size) noexcept { \ - void * p = (void*)win32_malloc(size); \ - if(!p) noperl_die("%s%s","Out of memory in perl:", "???"); return p; }; \ - void* operator new( size_t size, int block_use, \ - char const* file_name, int line_number) noexcept { \ - UNREFERENCED_PARAMETER(block_use); \ - UNREFERENCED_PARAMETER(file_name); \ - UNREFERENCED_PARAMETER(line_number); \ - void * p = (void*)win32_malloc(size); \ - if(!p) noperl_die("%s%s","Out of memory in perl:", "???"); return p; \ - }; \ - void* operator new[]( size_t size, int block_use, \ - char const* file_name, int line_number) noexcept { \ - UNREFERENCED_PARAMETER(block_use); \ - UNREFERENCED_PARAMETER(file_name); \ - UNREFERENCED_PARAMETER(line_number); \ - void * p = (void*)win32_malloc(size); \ - if(!p) noperl_die("%s%s","Out of memory in perl:", "???"); return p; }; \ - void operator delete (void* p) noexcept { win32_free(p); return; }; \ + void* operator new(size_t size) noexcept { \ + void * p = (void*)win32_malloc(size); \ + if (!p) noperl_die("%s%s","Out of memory in perl:", "???"); \ + return p; \ + }; \ + void* operator new[](size_t size) noexcept { \ + void * p = (void*)win32_malloc(size); \ + if (!p) noperl_die("%s%s","Out of memory in perl:", "???"); \ + return p; }; \ + void* operator new( size_t size, int block_use, \ + char const* file_name, int line_number) noexcept {\ + UNREFERENCED_PARAMETER(block_use); \ + UNREFERENCED_PARAMETER(file_name); \ + UNREFERENCED_PARAMETER(line_number); \ + void * p = (void*)win32_malloc(size); \ + if(!p) noperl_die("%s%s","Out of memory in perl:", "???"); \ + return p; \ + }; \ + void* operator new[]( size_t size, int block_use, \ + char const* file_name, int line_number) noexcept {\ + UNREFERENCED_PARAMETER(block_use); \ + UNREFERENCED_PARAMETER(file_name); \ + UNREFERENCED_PARAMETER(line_number); \ + void * p = (void*)win32_malloc(size); \ + if(!p) noperl_die("%s%s","Out of memory in perl:", "???"); \ + return p; }; \ + void operator delete (void* p) noexcept { win32_free(p); return; }; \ void operator delete[] (void* p) noexcept { win32_free(p); return; } @@ -210,7 +215,7 @@ VMem::VMem(void) { #ifdef _USE_LINKED_LIST InitializeCriticalSection(&m_cs); -#endif _USE_LINKED_LIST +#endif /* _USE_LINKED_LIST */ m_lRefCount = 1; return; } diff --git a/win32/win32.h b/win32/win32.h index 1b69d153c1f7..cd12a2fe3721 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -133,7 +133,8 @@ # define NOMEMMGR /* GUI IPC RPC malloc buffers */ # define NOMENUS /* GUI Menu obj */ # define NOMETAFILE /* file format for half rendered graphics */ -# define NOMINMAX /* "Macros min(a,b) and max(a,b)" OBSOL/UNIMPL/FUT */ +# undef NOMINMAX /* "Macros min(a,b) and max(a,b)" OBSOL/UNIMPL/FUT */ +# define NOMINMAX # define NOMSG /* GUI Message loop */ /* #define NONLS "Wide" Code Page conversion APIs */ /* OBSOL/UNIMPL/FUT "OpenFile(), OemToAnsi, AnsiToOem" etc */ diff --git a/win32/win32sck.c b/win32/win32sck.c index 7289a47d9b0b..6bfdee4f9e86 100644 --- a/win32/win32sck.c +++ b/win32/win32sck.c @@ -780,6 +780,7 @@ win32_getnetent(void) struct netent * win32_getnetbyname(char *name) { + PERL_UNUSED_ARG(name); win32_croak_not_implemented("getnetbyname"); return (struct netent *)NULL; } @@ -787,6 +788,8 @@ win32_getnetbyname(char *name) struct netent * win32_getnetbyaddr(long net, int type) { + PERL_UNUSED_ARG(net); + PERL_UNUSED_ARG(type); win32_croak_not_implemented("getnetbyaddr"); return (struct netent *)NULL; } @@ -808,6 +811,7 @@ win32_getservent(void) void win32_sethostent(int stayopen) { + PERL_UNUSED_ARG(stayopen); win32_croak_not_implemented("sethostent"); } @@ -815,6 +819,7 @@ win32_sethostent(int stayopen) void win32_setnetent(int stayopen) { + PERL_UNUSED_ARG(stayopen); win32_croak_not_implemented("setnetent"); } @@ -822,6 +827,7 @@ win32_setnetent(int stayopen) void win32_setprotoent(int stayopen) { + PERL_UNUSED_ARG(stayopen); win32_croak_not_implemented("setprotoent"); } @@ -829,6 +835,7 @@ win32_setprotoent(int stayopen) void win32_setservent(int stayopen) { + PERL_UNUSED_ARG(stayopen); win32_croak_not_implemented("setservent"); }