This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c, perl.c: Use 'VOL' not 'volatile'
authorKarl Williamson <khw@cpan.org>
Sat, 19 Mar 2016 15:10:41 +0000 (09:10 -0600)
committerKarl Williamson <khw@cpan.org>
Sat, 19 Mar 2016 16:03:30 +0000 (10:03 -0600)
I presume that VOL is so perl can at least compile on compilers that lack
'volatile'.  (It was added by Larry in 1991 by 352d5a3ab; there were
probably a lot more compilers like that back then.)  But VOL is used
consistently in the core, with these being the two exceptions.

perl.c
regcomp.c

diff --git a/perl.c b/perl.c
index 94c810e..15e9150 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -4939,7 +4939,7 @@ void
 Perl_call_list(pTHX_ I32 oldscope, AV *paramList)
 {
     SV *atsv;
-    volatile const line_t oldline = PL_curcop ? CopLINE(PL_curcop) : 0;
+    VOL const line_t oldline = PL_curcop ? CopLINE(PL_curcop) : 0;
     CV *cv;
     STRLEN len;
     int ret;
index f8dc8a1..646cf38 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -14547,9 +14547,9 @@ S_handle_regex_sets(pTHX_ RExC_state_t *pRExC_state, SV** return_invlist,
                                        'stack' of where the undealt-with left
                                        parens would be if they were actually
                                        put there */
-    /* The 'volatile' is a workaround for an optimiser bug
+    /* The 'VOL' (expanding to 'volatile') is a workaround for an optimiser bug
      * in Solaris Studio 12.3. See RT #127455 */
-    volatile IV fence = 0;          /* Position of where most recent undealt-
+    VOL IV fence = 0;               /* Position of where most recent undealt-
                                        with left paren in stack is; -1 if none.
                                      */
     STRLEN len;                     /* Temporary */