It's getting confused by the newline characters that are output as part of the gcc --version command. Here's one solution:
Code:
$ gcc -DGCCVERSION="\"$(gcc --version|tr '\n' ' ')\"" junk1.c
$ ./a
gcc (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125) Copyright (C) 2004 Free Software Found
ation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not
even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If you want to see what is going on during the preprocessing stage, use the -E flag on the main gcc call:
Code:
$ gcc -DGCCVERSION="\"$(gcc --version|tr '\n' ' ')\"" -E junk1.c
...
int main()
{
printf("%s\n", "gcc (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125) Copyright (C) 2004
Free Software Foundation, Inc. This is free software; see the source for copying conditions. There
is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ");
}