This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
remove bool* cast from SAVEBOOL
authorDavid Mitchell <davem@iabyn.com>
Wed, 21 Apr 2010 13:53:39 +0000 (14:53 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 21 Apr 2010 13:55:32 +0000 (14:55 +0100)
SAVEBOOL() should only be used on variables of type bool; casting
pointers to variables of other types into bool* is just wrong.

scope.h

diff --git a/scope.h b/scope.h
index 64e7e27..808108e 100644 (file)
--- a/scope.h
+++ b/scope.h
@@ -162,7 +162,7 @@ scope has the given name. Name must be a literal string.
 #define SAVEINT(i)     save_int((int*)&(i))
 #define SAVEIV(i)      save_iv((IV*)&(i))
 #define SAVELONG(l)    save_long((long*)&(l))
-#define SAVEBOOL(b)    save_bool((bool*)&(b))
+#define SAVEBOOL(b)    save_bool(&(b))
 #define SAVESPTR(s)    save_sptr((SV**)&(s))
 #define SAVEPPTR(s)    save_pptr((char**)&(s))
 #define SAVEVPTR(s)    save_vptr((void*)&(s))