Blame test-t/warns.t

Packit Service 8bf002
/*
Packit Service 8bf002
 *  warns.t:
Packit Service 8bf002
 * 1998/08      made public                                     kmatsui
Packit Service 8bf002
 * 2002/12      slightly modified                               kmatsui
Packit Service 8bf002
 * 2003/11      added a few samples                             kmatsui
Packit Service 8bf002
 */
Packit Service 8bf002
Packit Service 8bf002
/*
Packit Service 8bf002
 *   The following texts are legal but suspicious ones.  Good preprocessor
Packit Service 8bf002
 * will warn at these texts.
Packit Service 8bf002
 */
Packit Service 8bf002
Packit Service 8bf002
/* w.1.1:   "/*" in comment.    */
Packit Service 8bf002
/*  comment /*  nested comment and no closing   */
Packit Service 8bf002
Packit Service 8bf002
/* w.1.2:   Rescanning of replacement text involves succeding text. */
Packit Service 8bf002
#define sub( x, y)      (x - y)
Packit Service 8bf002
#define head            sub(
Packit Service 8bf002
    int     a = 1, b = 2, c;
Packit Service 8bf002
    c = head a,b );
Packit Service 8bf002
Packit Service 8bf002
#define OBJECT_LIKE     FUNCTION_LIKE
Packit Service 8bf002
#define FUNCTION_LIKE( x, y)    (x + y)
Packit Service 8bf002
    c = OBJECT_LIKE( a, b);     /* (a + b)  */
Packit Service 8bf002
Packit Service 8bf002
/* w.2.1:   Negative number converted to positive in #if expression.    */
Packit Service 8bf002
#if     -1 < 0U
Packit Service 8bf002
#endif
Packit Service 8bf002
Packit Service 8bf002
/* w.2.2:   Out of range of unsigned type (wraps around and never overflow)
Packit Service 8bf002
        in #if expression.  */
Packit Service 8bf002
#if     0U - 1
Packit Service 8bf002
#endif
Packit Service 8bf002
Packit Service 8bf002
/*
Packit Service 8bf002
 *   The following texts are legal but non-portable ones, since these requires
Packit Service 8bf002
 * translation limits greater than the minima quaranteed by C90.  Good
Packit Service 8bf002
 * preprocessor will warn at these texts (at least when user wants), unless
Packit Service 8bf002
 * it diagnose these as errors.
Packit Service 8bf002
 */
Packit Service 8bf002
Packit Service 8bf002
/* w.3.1:   Number of parameters in macro: more than 31.    */
Packit Service 8bf002
#define glue63(    \
Packit Service 8bf002
    a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0, p0, \
Packit Service 8bf002
    a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1, \
Packit Service 8bf002
    a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, \
Packit Service 8bf002
    a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3)     \
Packit Service 8bf002
    a0 ## b0 ## c0 ## d0 ## e0 ## f0 ## g0 ## h0 ## \
Packit Service 8bf002
    o0 ## o1 ## o2 ## o3 ## p0 ## p1 ## p2
Packit Service 8bf002
Packit Service 8bf002
/* w.3.2:   Number of arguments in macro call: more than 31.    */
Packit Service 8bf002
/*  A0B0C0D0E0F0G0H0O0O1O2O3P0P1P2; */
Packit Service 8bf002
    glue63(
Packit Service 8bf002
    A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0,
Packit Service 8bf002
    A1, B1, C1, D1, E1, F1, G1, H1, I1, J1, K1, L1, M1, N1, O1, P1,
Packit Service 8bf002
    A2, B2, C2, D2, E2, F2, G2, H2, I2, J2, K2, L2, M2, N2, O2, P2,
Packit Service 8bf002
    A3, B3, C3, D3, E3, F3, G3, H3, I3, J3, K3, L3, M3, N3, O3);
Packit Service 8bf002
Packit Service 8bf002
/* w.3.3:   Initial significant characters in an identifier: more than 31.  */
Packit Service 8bf002
    int
Packit Service 8bf002
A23456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef = 63;
Packit Service 8bf002
Packit Service 8bf002
Packit Service 8bf002
/* w.3.4:   Nested conditional inclusion: more than 8 levels.   */
Packit Service 8bf002
#define X0F
Packit Service 8bf002
/*  nest = 0x0f;    */
Packit Service 8bf002
#include    "ifdef15.h"
Packit Service 8bf002
Packit Service 8bf002
/* w.3.5:   Nested source file inclusion: more than 8 levels.   */
Packit Service 8bf002
#define X0F
Packit Service 8bf002
/*  nest = 0x0f;    */
Packit Service 8bf002
#include    "nest1.h"
Packit Service 8bf002
Packit Service 8bf002
/* w.3.6:   Parenthesized expression: more than 32 levels.  */
Packit Service 8bf002
/*  nest = 63;  */
Packit Service 8bf002
#if \
Packit Service 8bf002
        (0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \
Packit Service 8bf002
        (0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \
Packit Service 8bf002
        (0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \
Packit Service 8bf002
        (0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \
Packit Service 8bf002
        (0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \
Packit Service 8bf002
        (0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \
Packit Service 8bf002
        (0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \
Packit Service 8bf002
        (0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - 0x3E)           \
Packit Service 8bf002
        )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))   \
Packit Service 8bf002
        == -1
Packit Service 8bf002
    nest = 63;
Packit Service 8bf002
#endif
Packit Service 8bf002
Packit Service 8bf002
/* w.3.7:   Characters in a string (after concatenation): more than 509.    */
Packit Service 8bf002
    char    *string1023 =
Packit Service 8bf002
"123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
Packit Service 8bf002
1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
Packit Service 8bf002
2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
Packit Service 8bf002
3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
Packit Service 8bf002
4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
Packit Service 8bf002
5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
Packit Service 8bf002
6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
Packit Service 8bf002
7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
Packit Service 8bf002
8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
Packit Service 8bf002
9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
Packit Service 8bf002
a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
Packit Service 8bf002
b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
Packit Service 8bf002
c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
Packit Service 8bf002
d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
Packit Service 8bf002
e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
Packit Service 8bf002
f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
Packit Service 8bf002
;
Packit Service 8bf002
Packit Service 8bf002
/* w.3.8:   Characters in a logical source line: more than 509. */
Packit Service 8bf002
    int a123456789012345678901234567890 = 123450;   \
Packit Service 8bf002
    int b123456789012345678901234567890 = 123451;   \
Packit Service 8bf002
    int c123456789012345678901234567890 = 123452;   \
Packit Service 8bf002
    int d123456789012345678901234567890 = 123453;   \
Packit Service 8bf002
    int e123456789012345678901234567890 = 123454;   \
Packit Service 8bf002
    int f123456789012345678901234567890 = 123455;   \
Packit Service 8bf002
    int g123456789012345678901234567890 = 123456;   \
Packit Service 8bf002
    int h123456789012345678901234567890 = 123457;   \
Packit Service 8bf002
    int i123456789012345678901234567890 = 123458;   \
Packit Service 8bf002
    int j123456789012345678901234567890 = 123459;   \
Packit Service 8bf002
    int k123456789012345678901234567890 = 123460;   \
Packit Service 8bf002
    int l123456789012345678901234567890 = 123461;   \
Packit Service 8bf002
    int m123456789012345678901234567890 = 123462;   \
Packit Service 8bf002
    int n123456789012345678901234567890 = 123463;   \
Packit Service 8bf002
    int o123456789012345678901234567890 = 123464;   \
Packit Service 8bf002
    int p123456789012345678901234567890 = 123465;   \
Packit Service 8bf002
    int q123456789012345678901234567890 = 123466;   \
Packit Service 8bf002
    int r123456789012345678901234567890 = 123467;   \
Packit Service 8bf002
    int s123456789012345678901234567890 = 123468;   \
Packit Service 8bf002
    int t1234567890123456 = 123469;
Packit Service 8bf002
Packit Service 8bf002
/* w.3.9:   Macro definitions: more than 1024 (including predefined ones).  */
Packit Service 8bf002
#define X0400
Packit Service 8bf002
#include    "m4095.h"
Packit Service 8bf002
/*  0x0400; */
Packit Service 8bf002
    BNJ;
Packit Service 8bf002