[Mono-dev] Bug with mcs, gmcs nested preprocessor defines?

Marcel Ruff Marcel.Ruff at avitech-ag.com
Sun Dec 17 07:18:25 EST 2006


Hi,

i have a little code snippet which does not return
the expected output with mcs or gmcs.

On Windows, with csc, it outputs correctly

   PreBug.cs(6,1): warning CS1030: #warning: `A1'

whereas with mcs/gmcs i get

   PreBug.cs(6,1): warning CS1030: #warning: `A1'
   PreBug.cs(13,1): warning CS1030: #warning: `A2->else'

The second line (a nested define) i think is not correct,

thanks
Marcel

----------- PreBug.cs -----------
/*
mcs -warn:4 -define:A1 PreBug.cs

//Mono C# compiler version 1.1.13.8 and 1.1.18.1
PreBug.cs(6,1): warning CS1030: #warning: `A1'
PreBug.cs(13,1): warning CS1030: #warning: `A2->else'
*/

#if A1
#  warning A1
#elif A2
#  warning A2
#  if B2
#    warning A1->B2
#    define A1B2
#  else
#    warning A2->else
#  endif
#else
#  warning else
#endif
----------- PreBug.cs -----------




More information about the Mono-devel-list mailing list