X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/84b2b14beadff5ecd6b639a44c9ae7c2f1664528..d813941f8a2ed4bd4ce76bd185773b1551dc01d6:/warnings.h diff --git a/warnings.h b/warnings.h index 1157cb2..39ebe6a 100644 --- a/warnings.h +++ b/warnings.h @@ -1,8 +1,8 @@ /* -*- buffer-read-only: t -*- !!!!!!! DO NOT EDIT THIS FILE !!!!!!! - This file is built by warnings.pl + This file is built by regen/warnings.pl. Any changes made here will be lost! -*/ + */ #define Off(x) ((x) / 8) @@ -18,12 +18,15 @@ #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 (((STRLEN*)0)+1) /* use warnings 'all' */ +#define pWARN_NONE (((STRLEN*)0)+2) /* no warnings 'all' */ #define specialWARN(x) ((x) == pWARN_STD || (x) == pWARN_ALL || \ (x) == pWARN_NONE) +/* if PL_warnhook is set to this value, then warnings die */ +#define PERL_WARNHOOK_FATAL (&PL_sv_placeholder) + /* Warnings Categories added in Perl 5.008 */ #define WARN_ALL 0 @@ -73,20 +76,31 @@ #define WARN_UTF8 44 #define WARN_VOID 45 -/* Warnings Categories added in Perl 5.009 */ +/* Warnings Categories added in Perl 5.011 */ + +#define WARN_IMPRECISION 46 +#define WARN_ILLEGALPROTO 47 + +/* Warnings Categories added in Perl 5.013 */ -#define WARN_ASSERTIONS 46 +#define WARN_NON_UNICODE 48 +#define WARN_NONCHAR 49 +#define WARN_SURROGATE 50 -#define WARNsize 12 -#define WARN_ALLstring "\125\125\125\125\125\125\125\125\125\125\125\125" -#define WARN_NONEstring "\0\0\0\0\0\0\0\0\0\0\0\0" -#define WARN_TAINTstring "\0\0\0\0\0\0\0\0\0\100\0\0" +#define WARNsize 13 +#define WARN_ALLstring "\125\125\125\125\125\125\125\125\125\125\125\125\125" +#define WARN_NONEstring "\0\0\0\0\0\0\0\0\0\0\0\0\0" #define isLEXWARN_on (PL_curcop->cop_warnings != pWARN_STD) #define isLEXWARN_off (PL_curcop->cop_warnings == pWARN_STD) #define isWARN_ONCE (PL_dowarn & (G_WARN_ON|G_WARN_ONCE)) -#define isWARN_on(c,x) (IsSet(SvPVX_const(c), 2*(x))) -#define isWARNf_on(c,x) (IsSet(SvPVX_const(c), 2*(x)+1)) +#define isWARN_on(c,x) (IsSet((U8 *)(c + 1), 2*(x))) +#define isWARNf_on(c,x) (IsSet((U8 *)(c + 1), 2*(x)+1)) + +#define DUP_WARNINGS(p) \ + (specialWARN(p) ? (STRLEN*)(p) \ + : (STRLEN*)CopyD(p, PerlMemShared_malloc(sizeof(*p)+*p), sizeof(*p)+*p, \ + char)) #define ckWARN(w) Perl_ckwarn(aTHX_ packWARN(w)) #define ckWARN2(w1,w2) Perl_ckwarn(aTHX_ packWARN2(w1,w2)) @@ -98,6 +112,8 @@ #define ckWARN3_d(w1,w2,w3) Perl_ckwarn_d(aTHX_ packWARN3(w1,w2,w3)) #define ckWARN4_d(w1,w2,w3,w4) Perl_ckwarn_d(aTHX_ packWARN4(w1,w2,w3,w4)) +#define WARNshift 8 + #define packWARN(a) (a ) #define packWARN2(a,b) ((a) | ((b)<<8) ) #define packWARN3(a,b,c) ((a) | ((b)<<8) | ((c)<<16) ) @@ -117,4 +133,5 @@ isWARNf_on(PL_curcop->cop_warnings, unpackWARN4(x)))) /* end of file warnings.h */ + /* ex: set ro: */