bug-make
[Top][All Lists]
Advanced

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

Re: [bug #29244] MSVC Compatibility broken with main.c Revision 1.237 (w


From: Edward Welbourne
Subject: Re: [bug #29244] MSVC Compatibility broken with main.c Revision 1.237 (with Proposal for Fix)
Date: Wed, 17 Mar 2010 16:36:57 +0100

> the MSVC preprocessor doesn't support conditional compilation
> inside a macro expansion.

I take it that's <pseudocode>

        FUNCTION_LIKE_MACRO(early, args,
#ifdef SYMBOL
                        symbol,
#else
                        token,
#endif
                        remaining);

</pseudocode> which is indeed not supported by ANSI C:
<quote src="ANSI X3.159-1989, 3.8.3 Macro Replacement, closing words">

  If there are sequences of preprocessing tokens within the list of
  arguments that would otherwise act as preprocessing directives, the
  behavior is undefined.

</quote>

It should be easy to fix this; the usual pattern turns the above into

#ifdef SYMBOL
        FUNCTION_LIKE_MACRO(early, args, symbol, remaining);
#else
        FUNCTION_LIKE_MACRO(early, args, token, remaining);
#endif

which is entirely legitimate.

        Eddy.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]