From: Nicholas Clark Date: Sat, 4 Feb 2006 11:10:52 +0000 (+0000) Subject: warnings.h does some evil(*) pointer arithmetic on (SV *)0, so a X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=78db725db76314f0edb7f2ab8770841118d8ad2e;p=p5sagit%2Fp5-mst-13.2.git warnings.h does some evil(*) pointer arithmetic on (SV *)0, so a simple replace of Nullsv with NULL turns out to be a bad idea. * Technically undefined behaviour, I believe. p4raw-id: //depot/perl@27078 --- diff --git a/warnings.h b/warnings.h index 1157cb2..7ef3c04 100644 --- a/warnings.h +++ b/warnings.h @@ -18,8 +18,8 @@ #define G_WARN_ALL_MASK (G_WARN_ALL_ON|G_WARN_ALL_OFF) #define pWARN_STD NULL -#define pWARN_ALL (NULL+1) /* use warnings 'all' */ -#define pWARN_NONE (NULL+2) /* no warnings 'all' */ +#define pWARN_ALL (((SV*)0)+1) /* use warnings 'all' */ +#define pWARN_NONE (((SV*)0)+2) /* no warnings 'all' */ #define specialWARN(x) ((x) == pWARN_STD || (x) == pWARN_ALL || \ (x) == pWARN_NONE) diff --git a/warnings.pl b/warnings.pl index e8971d8..1265972 100644 --- a/warnings.pl +++ b/warnings.pl @@ -277,8 +277,8 @@ print WARN <<'EOM' ; #define G_WARN_ALL_MASK (G_WARN_ALL_ON|G_WARN_ALL_OFF) #define pWARN_STD NULL -#define pWARN_ALL (NULL+1) /* use warnings 'all' */ -#define pWARN_NONE (NULL+2) /* no warnings 'all' */ +#define pWARN_ALL (((SV*)0)+1) /* use warnings 'all' */ +#define pWARN_NONE (((SV*)0)+2) /* no warnings 'all' */ #define specialWARN(x) ((x) == pWARN_STD || (x) == pWARN_ALL || \ (x) == pWARN_NONE)