clarify what a "line" is
[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
7#define Off(x) ((x) / 8)
8#define Bit(x) (1 << ((x) % 8))
9#define IsSet(a, x) ((a)[Off(x)] & Bit(x))
10
11#define G_WARN_OFF 0 /* $^W == 0 */
12#define G_WARN_ON 1 /* $^W != 0 */
13#define G_WARN_ALL_ON 2 /* -W flag */
14#define G_WARN_ALL_OFF 4 /* -X flag */
15#define G_WARN_ALL_MASK (G_WARN_ALL_ON|G_WARN_ALL_OFF)
16
17#if 1
18
19/* Part of the logic below assumes that WARN_NONE is NULL */
20
21#define ckDEAD(x) \
e24b16f9 22 (PL_curcop->cop_warnings != WARN_ALL && \
23 PL_curcop->cop_warnings != WARN_NONE && \
24 IsSet(SvPVX(PL_curcop->cop_warnings), 2*x+1))
599cee73 25
26#define ckWARN(x) \
e24b16f9 27 ( (PL_curcop->cop_warnings && \
28 (PL_curcop->cop_warnings == WARN_ALL || \
29 IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) ) ) \
599cee73 30 || (PL_dowarn & G_WARN_ON) )
31
32#define ckWARN2(x,y) \
e24b16f9 33 ( (PL_curcop->cop_warnings && \
34 (PL_curcop->cop_warnings == WARN_ALL || \
35 IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) || \
36 IsSet(SvPVX(PL_curcop->cop_warnings), 2*y) ) ) \
599cee73 37 || (PL_dowarn & G_WARN_ON) )
38
39#else
40
e24b16f9 41#define ckDEAD(x) \
42 (PL_curcop->cop_warnings != WARN_ALL && \
43 PL_curcop->cop_warnings != WARN_NONE && \
44 SvPVX(PL_curcop->cop_warnings)[Off(2*x+1)] & Bit(2*x+1) )
599cee73 45
e24b16f9 46#define ckWARN(x) \
599cee73 47 ( (PL_dowarn & G_WARN_ON) || ( (PL_dowarn & G_WARN_DISABLE) && \
e24b16f9 48 PL_curcop->cop_warnings && \
49 ( PL_curcop->cop_warnings == WARN_ALL || \
50 SvPVX(PL_curcop->cop_warnings)[Off(2*x)] & Bit(2*x) ) ) )
599cee73 51
e24b16f9 52#define ckWARN2(x,y) \
599cee73 53 ( (PL_dowarn & G_WARN_ON) || ( (PL_dowarn & G_WARN_DISABLE) && \
e24b16f9 54 PL_curcop->cop_warnings && \
55 ( PL_curcop->cop_warnings == WARN_ALL || \
56 SvPVX(PL_curcop->cop_warnings)[Off(2*x)] & Bit(2*x) || \
57 SvPVX(PL_curcop->cop_warnings)[Off(2*y)] & Bit(2*y) ) ) )
599cee73 58
59#endif
60
61#define WARN_NONE NULL
e24b16f9 62#define WARN_ALL (&PL_sv_yes)
599cee73 63
95dfd3ab 64#define WARN_DEFAULT 0
65#define WARN_IO 1
66#define WARN_CLOSED 2
67#define WARN_EXEC 3
68#define WARN_NEWLINE 4
69#define WARN_PIPE 5
70#define WARN_UNOPENED 6
71#define WARN_MISC 7
72#define WARN_NUMERIC 8
73#define WARN_ONCE 9
74#define WARN_RECURSION 10
75#define WARN_REDEFINE 11
599cee73 76#define WARN_SYNTAX 12
95dfd3ab 77#define WARN_AMBIGUOUS 13
599cee73 78#define WARN_DEPRECATED 14
95dfd3ab 79#define WARN_OCTAL 15
80#define WARN_PARENTHESIS 16
81#define WARN_PRECEDENCE 17
82#define WARN_PRINTF 18
83#define WARN_RESERVED 19
84#define WARN_SEMICOLON 20
85#define WARN_UNINITIALIZED 21
86#define WARN_UNSAFE 22
87#define WARN_CLOSURE 23
88#define WARN_SIGNAL 24
89#define WARN_SUBSTR 25
90#define WARN_TAINT 26
91#define WARN_UNTIE 27
92#define WARN_UTF8 28
93#define WARN_VOID 29
599cee73 94
95#define WARNsize 8
96#define WARN_ALLstring "\125\125\125\125\125\125\125\125"
97#define WARN_NONEstring "\0\0\0\0\0\0\0\0"
98
99/* end of file warning.h */
100