Boost logo

Boost :

Subject: Re: [boost] [preprocessor] Sequences vs. All Other Data Structures
From: Edward Diener (eldiener_at_[hidden])
Date: 2012-04-24 09:00:34

On 4/24/2012 12:22 AM, Stephan T. Lavavej wrote:
> [Paul Mensonides]
>> It isn't that. VC++ doesn't even implement the preprocessor correctly for
>> C89. Essentially, the macro expansion algorithm appears to be
>> fundamentally broken. One small example:
>> #define A() 123
>> #define B() ()
>> A B() // should expand to A() (and does)
>> #define C() A B()
>> C() // should *still* expand to A() (but instead expands to 123)
> I have filed this as DevDiv#407151 "VC's preprocessor considered harmful (to Boost.Preprocessor)" in our internal database, including a copy of your entire mail.
> If it were within my power to fix this for you, I would - but I am not a compiler dev.

If you look at the Microsoft bug reporting page for preprocessors errors
you will see other problems with the preprocessor. A number of these are
basically the same problem with variadic macros, but others are just
basic erroneous proocessing of prepeocessor input and Microsoft's
response often is that it is the way the VC++ preprocessor works and
will not be changed even if it is erroneous.

Here are some links:

I know this is overkill to list these here, but it really is not done as
an attempt to embarass you or Microsoft. Rather it is proof of what Paul
has said, that Microsoft has taken the view that it is not important to
fix the prerocessor. Even if Microsoft were concerned with breaking
backward compatibility, ie. breaking code which uses the incorrect
implementation, in changing the preprocessor to actually be correct,
they could create a correct preprocessor and have a compiler switches to
enable the backward compatibility mode or the correct preprocessor mode
if they did so.

Boost list run by bdawes at, gregod at, cpdaniel at, john at