Integrate with Nick.
[p5sagit/p5-mst-13.2.git] / warning.h
CommitLineData
599cee73 1/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
2 This file is built by warning.pl
3 Any changes made here will be lost!
4*/
5
6
0453d815 7#define Off(x) ((x) / 8)
8#define Bit(x) (1 << ((x) % 8))
599cee73 9#define IsSet(a, x) ((a)[Off(x)] & Bit(x))
10
0453d815 11
599cee73 12#define G_WARN_OFF 0 /* $^W == 0 */
0453d815 13#define G_WARN_ON 1 /* -w flag and $^W != 0 */
599cee73 14#define G_WARN_ALL_ON 2 /* -W flag */
15#define G_WARN_ALL_OFF 4 /* -X flag */
0453d815 16#define G_WARN_ONCE 8 /* set if 'once' ever enabled */
599cee73 17#define G_WARN_ALL_MASK (G_WARN_ALL_ON|G_WARN_ALL_OFF)
18
0453d815 19#define WARN_STD Nullsv
20#define WARN_ALL (&PL_sv_yes) /* use warning 'all' */
21#define WARN_NONE (&PL_sv_no) /* no warning 'all' */
599cee73 22
0453d815 23#define specialWARN(x) ((x) == WARN_STD || (x) == WARN_ALL || \
24 (x) == WARN_NONE)
599cee73 25
26#define ckDEAD(x) \
0453d815 27 ( ! specialWARN(PL_curcop->cop_warnings) && \
e24b16f9 28 IsSet(SvPVX(PL_curcop->cop_warnings), 2*x+1))
599cee73 29
30#define ckWARN(x) \
0453d815 31 ( (PL_curcop->cop_warnings != WARN_STD && \
32 PL_curcop->cop_warnings != WARN_NONE && \
e24b16f9 33 (PL_curcop->cop_warnings == WARN_ALL || \
34 IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) ) ) \
0453d815 35 || (PL_curcop->cop_warnings == WARN_STD && PL_dowarn & G_WARN_ON) )
599cee73 36
37#define ckWARN2(x,y) \
0453d815 38 ( (PL_curcop->cop_warnings != WARN_STD && \
39 PL_curcop->cop_warnings != WARN_NONE && \
e24b16f9 40 (PL_curcop->cop_warnings == WARN_ALL || \
41 IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) || \
42 IsSet(SvPVX(PL_curcop->cop_warnings), 2*y) ) ) \
0453d815 43 || (PL_curcop->cop_warnings == WARN_STD && PL_dowarn & G_WARN_ON) )
44
45#define ckWARN_d(x) \
46 (PL_curcop->cop_warnings == WARN_STD || \
47 PL_curcop->cop_warnings == WARN_ALL || \
48 (PL_curcop->cop_warnings != WARN_NONE && \
49 IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) ) )
50
51#define ckWARN2_d(x,y) \
52 (PL_curcop->cop_warnings == WARN_STD || \
53 PL_curcop->cop_warnings == WARN_ALL || \
54 (PL_curcop->cop_warnings != WARN_NONE && \
55 (IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) || \
56 IsSet(SvPVX(PL_curcop->cop_warnings), 2*y) ) ) )
57
58
59#define isLEXWARN_on (PL_curcop->cop_warnings != WARN_STD)
60#define isLEXWARN_off (PL_curcop->cop_warnings == WARN_STD)
61#define isWARN_ONCE (PL_dowarn & (G_WARN_ON|G_WARN_ONCE))
62#define isWARN_on(c,x) (IsSet(SvPVX(c), 2*(x)))
63
64#define WARN_IO 0
65#define WARN_CLOSED 1
66#define WARN_EXEC 2
67#define WARN_NEWLINE 3
68#define WARN_PIPE 4
69#define WARN_UNOPENED 5
70#define WARN_MISC 6
71#define WARN_NUMERIC 7
72#define WARN_ONCE 8
73#define WARN_RECURSION 9
74#define WARN_REDEFINE 10
75#define WARN_SEVERE 11
76#define WARN_DEBUGGING 12
77#define WARN_INPLACE 13
78#define WARN_INTERNAL 14
79#define WARN_SYNTAX 15
80#define WARN_AMBIGUOUS 16
81#define WARN_DEPRECATED 17
82#define WARN_OCTAL 18
83#define WARN_PARENTHESIS 19
84#define WARN_PRECEDENCE 20
85#define WARN_PRINTF 21
86#define WARN_RESERVED 22
87#define WARN_SEMICOLON 23
88#define WARN_UNINITIALIZED 24
89#define WARN_UNSAFE 25
90#define WARN_CLOSURE 26
91#define WARN_SIGNAL 27
92#define WARN_SUBSTR 28
93#define WARN_TAINT 29
94#define WARN_UNTIE 30
95#define WARN_UTF8 31
96#define WARN_VOID 32
97
98#define WARNsize 9
99#define WARN_ALLstring "\125\125\125\125\125\125\125\125\125"
100#define WARN_NONEstring "\0\0\0\0\0\0\0\0\0"
599cee73 101
102/* end of file warning.h */
103