develooper Front page | perl.perl5.porters | Postings from January 2008

FW: [PATCH] RE: [PATCH] volatile, avoid clobbered

Thread Next
Robin Barker
January 23, 2008 10:51
FW: [PATCH] RE: [PATCH] volatile, avoid clobbered
Message ID:
> 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

Perhaps this is better, I've moved the VOL on the first line 

(cargo-culting from the C<SV * VOL sv = NULL> line) which

removed the need for the subsequent cast.


diff -ur ../perl-current/op.c ./op.c

--- ../perl-current/op.c	2008-01-11 17:04:39.000000000 +0000

+++ ./op.c

@@ -2343,7 +2343,7 @@

 Perl_fold_constants(pTHX_ register OP *o)



-    register OP *curop;

+    register OP * VOL curop;

     OP *newop;

     VOL I32 type = o->op_type;

     SV * VOL sv = NULL;

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 @@




-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 @@



 #if defined(HASVOLATILE) || defined(STANDARD_C)

-#   ifdef __cplusplus

-#	define VOL		/* to temporarily suppress warnings */

-#   else

 #	define VOL volatile

-#   endif


 #   define VOL



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


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About