File: chains

package info (click to toggle)
cpphs 0.7-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 360 kB
  • ctags: 18
  • sloc: haskell: 940; makefile: 79; sh: 36; ansic: 11
file content (16 lines) | stat: -rw-r--r-- 492 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
For this test, assume that all of e,f,g,h are defined.
Also that c,d are defined, a,b are not.
If cpphs does operator precedence wrongly in infix chains, the final
conditional will be interpreted wrongly.

#if defined(a) || defined(b) || defined(c) || defined(d)
chained || OK
#endif
#if defined(e) && defined(f) && defined(g) && defined(h)
chained && OK
#endif
#if defined(a) && defined(b) || defined(c) && defined(d)
mixed chain of || and && OK
#else
mixed chain of || and && BROKEN
#endif