Front page | perl.perl5.porters |
Postings from January 2008
[PATCH] volatile, avoid clobbered
From:
Robin Barker
Date:
January 23, 2008 06:00
Subject:
[PATCH] volatile, avoid clobbered
Message ID:
46A0F33545E63740BC7563DE59CA9C6D093A00@exchsvr2.npl.ad.local
Not sure if this is the right way to go, but the addition of a couple
of "VOL" removes the "may be clobbered" warnings (with gcc and g++).
Robin Barker
diff -ur ../perl-current/op.c ./op.c
--- ../perl-current/op.c 2008-01-11 17:04:39.000000000 +0000
+++ ./op.
@@ -2343,7 +2343,7 @@
Perl_fold_constants(pTHX_ register OP *o)
{
dVAR;
- register OP *curop;
+ VOL register OP *curop;
OP *newop;
VOL I32 type = o->op_type;
SV * VOL sv = NULL;
@@ -2408,7 +2408,7 @@
curop = LINKLIST(o);
old_next = o->op_next;
o->op_next = 0;
- PL_op = curop;
+ PL_op = (OP *)curop;
oldscope = PL_scopestack_ix;
create_eval_scope(G_FAKINGEVAL);
Only in ../perl-current: .patch
diff -ur ../perl-current/perl.c ./perl.c
--- ../perl-current/perl.c 2008-01-21 13:09:37.000000000 +0000
+++ ./perl.c
@@ -2560,7 +2560,7 @@
*/
I32
-Perl_call_sv(pTHX_ SV *sv, I32 flags)
+Perl_call_sv(pTHX_ SV *sv, VOL I32 flags)
/* See G_* flags in cop.h */
{
dVAR; dSP;
diff -ur ../perl-current/perl.h ./perl.h
--- ../perl-current/perl.h 2008-01-18 14:28:02.000000000 +0000
+++ ./perl.h
@@ -524,11 +524,7 @@
#endif
#if defined(HASVOLATILE) || defined(STANDARD_C)
-# ifdef __cplusplus
-# define VOL /* to temporarily suppress warnings */
-# else
# define VOL volatile
-# endif
#else
# define VOL
#endif
End of patch
<<volatile.patch>>
-------------------------------------------------------------------
This e-mail and any attachments may contain confidential and/or
privileged material; it is for the intended addressee(s) only.
If you are not a named addressee, you must not use, retain or
disclose such information.
NPL Management Ltd cannot guarantee that the e-mail or any
attachments are free from viruses.
NPL Management Ltd. Registered in England and Wales. No: 2937881
Registered Office: Serco House, 16 Bartley Wood Business Park,
Hook, Hampshire, United Kingdom RG27 9UY
-------------------------------------------------------------------
-
[PATCH] volatile, avoid clobbered
by Robin Barker