File: e_std99.t

package info (click to toggle)
mcpp 2.7.2-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 8,152 kB
  • ctags: 29,136
  • sloc: ansic: 35,238; sh: 9,241; makefile: 176; cpp: 84; exp: 18
file content (66 lines) | stat: -rw-r--r-- 1,643 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
 *      e_std99.t
 *
 * 2002/08      made public                                     kmatsui
 * 2003/11      added a few samples                             kmatsui
 *
 * Samples to test Standard C99 preprocessing.
 * C99 preprocessor must diagnose all of these samples appropriately.
 */


/* e_ucn.t:     Errors of Universal-character-name sequense.    */

#define macro\U0000001F     violation of constraint
#define macro\uD800         violation of constraint (only C, not for C++)
#define macro\u123          too short sequence (violation of syntax rule)
#define macro\U1234567      also too short sequence


/* e_intmax.t:  Overflow of constant expression in #if directive.    */

#include    <stdint.h>

#if     INTMAX_MAX - INTMAX_MIN
#endif
#if     INTMAX_MAX + 1
#endif
#if     INTMAX_MIN - 1
#endif
#if     INTMAX_MAX * 2
#endif

#include	<limits.h>

#if     LLONG_MAX - LLONG_MIN
#endif
#if     LLONG_MAX + 1
#endif
#if     LLONG_MIN - 1
#endif
#if     LLONG_MAX * 2
#endif


/* e_pragma.t:  Erroneous use of _Pragma() operator */
        /* Operand of _Pragma() should be a string literal  */
    _Pragma( This is not a string literal)


/* e_vargs1.t:  Erroneous usage of __VA_ARGS__  */

/* __VA_ARGS__ should not be defined.   */
    #define __VA_ARGS__ (x, y, z)

/*
 * __VA_ARGS__ should be the parameter name in replacement list
 * corresponding to '...'.
 */
    #define wrong_macro( a, b, __VA_ARGS__) (a + b - __VA_ARGS__)


/* e_vargs2.t:  Erroneous macro invocation of variable arguments    */
    #define debug( ...) fprintf( stderr, __VA_ARGS__)
        /* No argument to correspond __VA_ARGS__    */
    debug();