File: recurs.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 (21 lines) | stat: -rw-r--r-- 659 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* recurs.t:    recursive macro */
/* The sample posted to comp.std.c by B. Stroustrap.    */

#define NIL(xxx)    xxx
#define G_0(arg)    NIL(G_1)(arg)
#define G_1(arg)    NIL(arg)

G_0(42)

/*
 * Note by kmatsui:
 * There are two interpretations on the Standard's specification.
 * (1)  This macro should be expanded to 'NIL(42)'.
 * (2)  This macro should be expanded to '42'.
 * The Standard's wording seems to justify the (1).
 * GCC, Visual C++ and other major implementations, however, expand
 * this macro as (2).
 * MCPP V.2.4.1 or later of Standard mode expands this as (1) by default,
 * and expands as (2) when invoked with -@compat option.
 */