RE: Defining and undefining #defines from command line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi José,

The -UAGE will not undefine #define's in your source code.

The -UAGE will undefine predefines by GCC.  (Or undefine -DAGE that occurred earlier in the command line.)

This is what you are trying to do:

#include<stdio.h>
#ifndef AGE
#define AGE 29
#endif
int main()
{
  printf("Hello, I'm %d years old\n",AGE);
  return 0;
}

gcc -DAGE=30 hello.c -o hello

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux