File: u_1_19.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 (37 lines) | stat: -rw-r--r-- 1,006 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
/* u_1_19.t:    Undefined behaviors on undefined #define and #undef syntax. */

/* u.1.19:  A macro expanded to "defined" in #if expression.    */
#define DEFINED     defined
#if     DEFINED DEFINED
#endif

#undef  __linux__
#undef  __arm__
#define __linux__   1
#define HAVE_MREMAP defined(__linux__) && !defined(__arm__)
/* Wrong macro definition.
 * This macro should be defined as follows.
 *  #if defined(__linux__) && !defined(__arm__)
 *  #define HAVE_MREMAP 1
 *  #endif
 */
#if HAVE_MREMAP
    mremap();
#endif

/* u.1.20:  Undefining __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ or
        "defined" in #undef directive.  */
#undef  __LINE__
/*  16; or other undefined result.  */
    __LINE__;

/* u.1.21:  Defining __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ or
        "defined" in #define directive. */
#define __LINE__    1234
/*  18; or other undefined result.  */
    __LINE__;
#define defined     defined
#if     defined defined
#   error   I am not a good preprocessor.
#endif