next up previous contents
Next: Usage Statement Up: Conditional Compilation Analyzer User's Previous: Installation Guide

Operational Walkthrough

cca is called from the command line.

In the following examples, foo.c is the following:

main(){
#ifndef FOO
#define FOO 1
  int foo_temp = FOO;
  printf("FOO = %d\n", foo_temp);
#else
  int bar;
  scanf("%d", &bar);
#endif /* FOO */
  printf("Hello, world!\n");

#ifdef N
#if N == 42
  printf("The ultimate answer is 42\n");
#elif N == 13
  printf("Boy are you unlucky.\n");
#else
  printf("This number isn't very interesting.\n");
  exit();
#ifndef TIME
  printf("You are out of TIME.\n");
#endif /* TIME */
#endif /* N == 42 */
#else
#define N 7
  int n = 7;
  printf("We all know n = %d\n", n);
#endif /* N */

}