summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--perlio.c6
-rw-r--r--reentr.c2
-rw-r--r--regen/reentr.pl2
-rw-r--r--time64.c2
-rw-r--r--util.c6
-rw-r--r--win32/perlhost.h2
-rw-r--r--win32/win32.c2
7 files changed, 12 insertions, 10 deletions
diff --git a/perlio.c b/perlio.c
index 0b5b4116d7..54ca051a1d 100644
--- a/perlio.c
+++ b/perlio.c
@@ -4847,8 +4847,8 @@ Perl_PerlIO_stderr(pTHX)
char *
PerlIO_getname(PerlIO *f, char *buf)
{
- dTHX;
#ifdef VMS
+ dTHX;
char *name = NULL;
bool exported = FALSE;
FILE *stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
@@ -4864,7 +4864,7 @@ PerlIO_getname(PerlIO *f, char *buf)
#else
PERL_UNUSED_ARG(f);
PERL_UNUSED_ARG(buf);
- Perl_croak(aTHX_ "Don't know how to get file name");
+ Perl_croak_nocontext("Don't know how to get file name");
return NULL;
#endif
}
@@ -5004,7 +5004,9 @@ PerlIO_stdoutf(const char *fmt, ...)
PerlIO *
PerlIO_tmpfile(void)
{
+#ifndef WIN32
dTHX;
+#endif
PerlIO *f = NULL;
#ifdef WIN32
const int fd = win32_tmpfd();
diff --git a/reentr.c b/reentr.c
index e7e2b24746..31b933c229 100644
--- a/reentr.c
+++ b/reentr.c
@@ -300,10 +300,10 @@ Perl_reentrant_free(pTHX) {
void*
Perl_reentrant_retry(const char *f, ...)
{
- dTHX;
void *retptr = NULL;
va_list ap;
#ifdef USE_REENTRANT_API
+ dTHX;
/* Easier to special case this here than in embed.pl. (Look at what it
generates for proto.h) */
PERL_ARGS_ASSERT_REENTRANT_RETRY;
diff --git a/regen/reentr.pl b/regen/reentr.pl
index 49d7efa167..899e83b847 100644
--- a/regen/reentr.pl
+++ b/regen/reentr.pl
@@ -835,10 +835,10 @@ Perl_reentrant_free(pTHX) {
void*
Perl_reentrant_retry(const char *f, ...)
{
- dTHX;
void *retptr = NULL;
va_list ap;
#ifdef USE_REENTRANT_API
+ dTHX;
/* Easier to special case this here than in embed.pl. (Look at what it
generates for proto.h) */
PERL_ARGS_ASSERT_REENTRANT_RETRY;
diff --git a/time64.c b/time64.c
index 9faab1046e..7b08d41d65 100644
--- a/time64.c
+++ b/time64.c
@@ -303,7 +303,9 @@ static void S_copy_little_tm_to_big_TM(const struct tm *src, struct TM *dest) {
#ifndef HAS_LOCALTIME_R
/* Simulate localtime_r() to the best of our ability */
static struct tm * S_localtime_r(const time_t *clock, struct tm *result) {
+#ifdef VMS
dTHX; /* in case the following is defined as Perl_my_localtime(aTHX_ ...) */
+#endif
const struct tm *static_result = localtime(clock);
assert(result != NULL);
diff --git a/util.c b/util.c
index e684075fc9..bbb3b0f9ad 100644
--- a/util.c
+++ b/util.c
@@ -5989,7 +5989,6 @@ getting C<vsnprintf>.
int
Perl_my_snprintf(char *buffer, const Size_t len, const char *format, ...)
{
- dTHX;
int retval;
va_list ap;
PERL_ARGS_ASSERT_MY_SNPRINTF;
@@ -6008,7 +6007,7 @@ Perl_my_snprintf(char *buffer, const Size_t len, const char *format, ...)
(len > 0 && (Size_t)retval >= len)
#endif
)
- Perl_croak(aTHX_ "panic: my_snprintf buffer overflow");
+ Perl_croak_nocontext("panic: my_snprintf buffer overflow");
return retval;
}
@@ -6026,7 +6025,6 @@ C<sv_vcatpvf> instead, or getting C<vsnprintf>.
int
Perl_my_vsnprintf(char *buffer, const Size_t len, const char *format, va_list ap)
{
- dTHX;
int retval;
#ifdef NEED_VA_COPY
va_list apc;
@@ -6054,7 +6052,7 @@ Perl_my_vsnprintf(char *buffer, const Size_t len, const char *format, va_list ap
(len > 0 && (Size_t)retval >= len)
#endif
)
- Perl_croak(aTHX_ "panic: my_vsnprintf buffer overflow");
+ Perl_croak_nocontext("panic: my_vsnprintf buffer overflow");
return retval;
}
diff --git a/win32/perlhost.h b/win32/perlhost.h
index bd3d1a9fa4..265328b69b 100644
--- a/win32/perlhost.h
+++ b/win32/perlhost.h
@@ -1892,6 +1892,8 @@ PerlProcSpawnvp(struct IPerlProc* piPerl, int mode, const char *cmdname, const c
int
PerlProcLastHost(struct IPerlProc* piPerl)
{
+ /* this dTHX is unused in an optimized build since CPerlHost::num_hosts
+ is a static */
dTHX;
CPerlHost *h = (CPerlHost*)w32_internal_host;
return h->LastHost();
diff --git a/win32/win32.c b/win32/win32.c
index f0b2ec0f7f..f9e8d97bb9 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -384,7 +384,6 @@ get_emd_part(SV **prev_pathp, STRLEN *const len, char *trailing_path, ...)
EXTERN_C char *
win32_get_privlib(const char *pl, STRLEN *const len)
{
- dTHX;
char *stdlib = "lib";
char buffer[MAX_PATH+1];
SV *sv = NULL;
@@ -544,7 +543,6 @@ tokenize(const char *str, char **dest, char ***destv)
char **retvstart = 0;
int items = -1;
if (str) {
- dTHX;
int slen = strlen(str);
char *ret;
char **retv;