This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
C preprocessor problem
- From: "Bansidhar Arvind Deshpande - CTD, Chennai." <bansidhara at ctd dot hcltech dot com>
- To: GNU GCC <gcc-help at gcc dot gnu dot org>
- Date: Thu, 16 Oct 2003 14:13:25 +0530
- Subject: C preprocessor problem
hi all,
I am trying to use -undef C preprocessor option.
I am interested to know whether my knowlege about this option is correct or
not.
/*c_test.c*/
int main()
{
int x ;
x = CMD_SYM;
return x;
}
I preprocessesed this file with following command line options
cpp -DCMD_SYM=10 -undef c_test.c
This produced following output on stdout
# 2 "c_test.c"
int main()
{
int x ;
x = 10;
return x;
}
Now my question is why CMD_SYM symbol is getting replaced with 10 though I
have
given command line option " -undef " to decable such predefined definitions.
GNU manual says about -undef as follows