New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] dXSUB_SYS -> dNOOP instead of empty string #14950
Comments
From @bulk88Created by @bulk88See attached patch. "possible future refactoring" refers to cperl where Perl Info
|
From @bulk880001-dXSUB_SYS-dNOOP-instead-of-empty-string.patchFrom 0fb62dc69f68f9102e039636053e53f37cec3210 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Wed, 30 Sep 2015 23:48:02 -0400
Subject: [PATCH] dXSUB_SYS -> dNOOP instead of empty string
Visual C 2003 says errors out saying that "int b" is a non-C89
mixed declaration and statement for example "int a;;int b;". dXSUB_SYS is
so rarely used that it happened to be the last declaration line at the
start of a block, so whether it is a declaration or statement is ambigious
and thus not failing in the past. In possible future refactoring,
dXSUB_SYS needs to be a proper declaration that can be placed anywhere
declarations can be placed.
---
dosish.h | 2 +-
plan9/plan9ish.h | 2 +-
symbian/symbianish.h | 2 +-
unixish.h | 2 +-
vms/vmsish.h | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dosish.h b/dosish.h
index 2e4e745..9256e0f 100644
--- a/dosish.h
+++ b/dosish.h
@@ -56,7 +56,7 @@
HINTS_REFCNT_TERM; OP_CHECK_MUTEX_TERM; \
OP_REFCNT_TERM; PERLIO_TERM; MALLOC_TERM
#endif
-#define dXSUB_SYS
+#define dXSUB_SYS dNOOP
/* USEMYBINMODE
* This symbol, if defined, indicates that the program should
diff --git a/plan9/plan9ish.h b/plan9/plan9ish.h
index 0fdce12..5c326f6 100644
--- a/plan9/plan9ish.h
+++ b/plan9/plan9ish.h
@@ -106,7 +106,7 @@
#define BIT_BUCKET "/dev/null"
#define PERL_SYS_INIT_BODY(c,v) \
MALLOC_CHECK_TAINT2(*c,*v) PERLIO_INIT; MALLOC_INIT
-#define dXSUB_SYS
+#define dXSUB_SYS dNOOP
#define PERL_SYS_TERM_BODY() PERLIO_TERM; MALLOC_TERM
/*
diff --git a/symbian/symbianish.h b/symbian/symbianish.h
index da5332c..17c4304 100644
--- a/symbian/symbianish.h
+++ b/symbian/symbianish.h
@@ -126,7 +126,7 @@
#define BIT_BUCKET "NUL:"
-#define dXSUB_SYS
+#define dXSUB_SYS dNOOP
#define NO_ENVIRON_ARRAY
diff --git a/unixish.h b/unixish.h
index 5b57138..cea36b8 100644
--- a/unixish.h
+++ b/unixish.h
@@ -157,7 +157,7 @@ int afstat(int fd, struct stat *statb);
#define BIT_BUCKET "/dev/null"
-#define dXSUB_SYS
+#define dXSUB_SYS dNOOP
#ifndef NO_ENVIRON_ARRAY
#define USE_ENVIRON_ARRAY
diff --git a/vms/vmsish.h b/vms/vmsish.h
index d175b18..76fb92b 100644
--- a/vms/vmsish.h
+++ b/vms/vmsish.h
@@ -316,7 +316,7 @@ struct interp_intern {
#define BIT_BUCKET "/dev/null"
#define PERL_SYS_INIT_BODY(c,v) MALLOC_CHECK_TAINT2(*c,*v) vms_image_init((c),(v)); PERLIO_INIT; MALLOC_INIT
#define PERL_SYS_TERM_BODY() HINTS_REFCNT_TERM; OP_REFCNT_TERM; PERLIO_TERM; MALLOC_TERM
-#define dXSUB_SYS
+#define dXSUB_SYS dNOOP
#define HAS_KILL
#define HAS_WAIT
--
1.7.9.msysgit.0
|
From @tonycozOn Wed Sep 30 20:57:17 2015, bulk88 wrote:
In this case I think it's the d prefix on the name that's incorrect. The only non-empty definition of dXSUB_SYS is in os2/os2ish.h, where it's defined as a macro call: os2/os2ish.h:#define dXSUB_SYS OS2_XS_init() which becomes a function call through a pointer: os2/os2ish.h:#define OS2_XS_init() (*OS2_Perl_data.xs_init)(aTHX) Tony |
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Mon Oct 12 15:58:33 2015, tonyc wrote:
Rejecting this patch. Tony |
@tonycoz - Status changed from 'open' to 'rejected' |
From @bulk88On Mon Oct 12 15:58:33 2015, tonyc wrote:
The d prefix is not incorrect, the last patch to touch the code was incorrect, no ML archive of this patch tho due to oldness + BUILD PROCESS Mon, 7 Apr 1997 00:00:00 +0000 (00:00 +0000) diff --git a/os2/os2ish.h b/os2/os2ish.h -#define dXSUB_SYS int fake = OS2_XS_init() So originally it was a declaration, a faulty patch later turned into non-declaration. Probably what happened was some CCs were giving unused var warnings, and to quickly silence them the macro was made empty instead of dummy C auto since the API/Macros to have unused nonwarning declarations didn't exist yet in Perl API. For example this commit from Thu, 27 Mar 1997 01:23:14 +0000 (20:23 -0500) http://perl5.git.perl.org/perl.git/commitdiff/a3c8358ce414426ff5d7d0ca29f8d98f18d4c878 which 2 weeks later was followed by the OS2 patch (Mon, 7 Apr 1997) above that de-declarationed the macro. Macro dNOOP did not exist until 2 years later ( Wed, 9 Jun 1999 18:03:01 +0000 (18:03 +0000)) in http://perl5.git.perl.org/perl.git/commitdiff/cea2e8a9dd23747fd2b66edc86c58c64e9970321 . PERL_UNUSED_DECL is 2 years newer than dNOOP, PERL_UNUSED_DECL was created on Wed Jun 13 09:44:58 2001 in http://perl5.git.perl.org/perl.git/commitdiff/44dbb6954f87e9897f792db3f9f84f1f3ba8701a . Day 1 (March 1996) of dXSUB_SYS macro in http://perl5.git.perl.org/perl.git/commitdiff/59c30bed0921653934e0dff5f5245a2290cee8b6 and http://perl5.git.perl.org/perl.git/commitdiff/bef10a86a57eda3140922972782e9a32409f68cc shows it was a real declaration and therefore the intent is that is really is a declaration.
-- |
@tonycoz - Status changed from 'rejected' to 'open' |
From @tonycozOn Sun Oct 18 18:52:10 2015, bulk88 wrote:
I've reopened the ticket. As is, the patch is incomplete, since one of the dXSUB_SYS definitions is still not a valid declaration. Tony |
From @ysthOn Sun, Oct 18, 2015 at 6:52 PM, bulk88 via RT
The xray archives go back to 1995: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/ but in a quick glance through, I didn't see this patch. |
From @rurbanSo there are two options, besides rejecting bulk's dNOOP patch. * Revert chip's patch so that dXSUB_SYS is a declaration again. * Or rename dXSUB_SYS to PERL_XSUB_SYS, and reorder a couple of places so that BTW: dNOOP is also no declaration, and will fail with strict compilers also if used as declaration. -- |
From @rurbanOn Mon Oct 19 16:20:17 2015, rurban wrote:
Well, I had to add PERL_UNUSED_DECL so it's still quite big, as it has to be the last decl,
-- |
From @bulk88On Mon Oct 19 16:20:17 2015, rurban wrote:
If that is the case, dNOOP is incorrectly implemented for that "strict compiler" build permutation in perl.h. P5P perl currently has #define NOOP /*EMPTY*/(void)0 I am leaning towards reverting the 1997 chip patch, but I'd rather go towards whatever solution is common to cperl and perl to the sake of commonality. -- |
From @tonycozOn Mon Oct 19 21:06:37 2015, bulk88 wrote:
How about the attached? Tony |
From @tonycoz0001-perl-126228-partly-revert-8cc95fdb-and-fix-a3c8358c.patchFrom c41cb50c0872b61d81cb282f8baadd55e36627be Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Mon, 16 May 2016 16:51:51 +1000
Subject: [PATCH] (perl #126228) partly revert 8cc95fdb and fix a3c8358c
a3c8358c changed:
-#define dXSUB_SYS int dummy
+#define dXSUB_SYS
which made dXSUB_SYS into not-a-declaration, this apparently broke
something, since 8cc95fdb then went through all the definitions of
dXSUB_SYS, made each of them into not-a-declaration and then
ensured ExtUtilis::Miniperl emitted dXSUB_SYS in a place where it
didn't matter whether it was a declaration or a statement.
When these changes were made perl.h didn't have dNOOP, but now we
do, so we can make dXSUB_SYS a declaration again, as its name
implies.
Based on a patch originally created by Daniel Dragan (bulk88).
---
dosish.h | 2 +-
os2/os2ish.h | 2 +-
plan9/plan9ish.h | 2 +-
symbian/symbianish.h | 2 +-
unixish.h | 2 +-
vms/vmsish.h | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dosish.h b/dosish.h
index c1305cd..1dc9322 100644
--- a/dosish.h
+++ b/dosish.h
@@ -56,7 +56,7 @@
HINTS_REFCNT_TERM; OP_CHECK_MUTEX_TERM; \
OP_REFCNT_TERM; PERLIO_TERM; MALLOC_TERM; LOCALE_TERM;
#endif
-#define dXSUB_SYS
+#define dXSUB_SYS dNOOP
/* USEMYBINMODE
* This symbol, if defined, indicates that the program should
diff --git a/os2/os2ish.h b/os2/os2ish.h
index 70c8cbe..fb71cd0 100644
--- a/os2/os2ish.h
+++ b/os2/os2ish.h
@@ -274,7 +274,7 @@ void Perl_OS2_term(void **excH, int exitstatus, int flags);
/* #define PERL_SYS_TERM_BODY() STMT_START { \
if (Perl_HAB_set) WinTerminate(Perl_hab); } STMT_END */
-#define dXSUB_SYS OS2_XS_init()
+#define dXSUB_SYS int fake = OS2_XS_init() PERL_UNUSED_DECL
#ifdef PERL_IS_AOUT
/* # define HAS_FORK */
diff --git a/plan9/plan9ish.h b/plan9/plan9ish.h
index 0fdce12..5c326f6 100644
--- a/plan9/plan9ish.h
+++ b/plan9/plan9ish.h
@@ -106,7 +106,7 @@
#define BIT_BUCKET "/dev/null"
#define PERL_SYS_INIT_BODY(c,v) \
MALLOC_CHECK_TAINT2(*c,*v) PERLIO_INIT; MALLOC_INIT
-#define dXSUB_SYS
+#define dXSUB_SYS dNOOP
#define PERL_SYS_TERM_BODY() PERLIO_TERM; MALLOC_TERM
/*
diff --git a/symbian/symbianish.h b/symbian/symbianish.h
index 80c580b..9100405 100644
--- a/symbian/symbianish.h
+++ b/symbian/symbianish.h
@@ -128,7 +128,7 @@
#define BIT_BUCKET "NUL:"
-#define dXSUB_SYS
+#define dXSUB_SYS dNOOP
#define NO_ENVIRON_ARRAY
diff --git a/unixish.h b/unixish.h
index e05cb6a..4cd8e43 100644
--- a/unixish.h
+++ b/unixish.h
@@ -159,7 +159,7 @@ int afstat(int fd, struct stat *statb);
#define BIT_BUCKET "/dev/null"
-#define dXSUB_SYS
+#define dXSUB_SYS dNOOP
#ifndef NO_ENVIRON_ARRAY
#define USE_ENVIRON_ARRAY
diff --git a/vms/vmsish.h b/vms/vmsish.h
index 1aea829..5011590 100644
--- a/vms/vmsish.h
+++ b/vms/vmsish.h
@@ -317,7 +317,7 @@ struct interp_intern {
#define PERL_SYS_INIT_BODY(c,v) MALLOC_CHECK_TAINT2(*c,*v) vms_image_init((c),(v)); PERLIO_INIT; MALLOC_INIT
#define PERL_SYS_TERM_BODY() HINTS_REFCNT_TERM; OP_REFCNT_TERM; \
PERLIO_TERM; MALLOC_TERM; LOCALE_TERM
-#define dXSUB_SYS
+#define dXSUB_SYS dNOOP
#define HAS_KILL
#define HAS_WAIT
--
2.1.4
|
From @tonycozOn Mon, 16 May 2016 00:08:41 -0700, tonyc wrote:
Applied as 564894e. Tony |
@tonycoz - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.26.0, this and 210 other issues have been Perl 5.26.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#126228 (status was 'resolved')
Searchable as RT126228$
The text was updated successfully, but these errors were encountered: