|
Boost : |
From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-11-25 21:43:50
At 12:16 PM 11/24/2001, Aleksey Gurtovoy wrote:
>4) Bad news - Metrowerks Codewarrior 7.0 has a bug in preprocessor (to be
>more concrete, in function-like macro replacement mechanism) that
restricts
>usage of the library to only very simple cases, at least if you don't
write
>code that specifically address this issue; for example, the above
>NUMBERED_EXPRESSION example doesn't compile on CW 7.0. Below is a simple
>test case that reproduces the bug:
>
> #define IDENTITY_MACRO(x) IDENTITY_MACRO_BODY(x)
> #define IDENTITY_MACRO_BODY(x) x
> #define COMMA_TOKEN() ,
>
> int a IDENTITY_MACRO(COMMA_TOKEN)() b; // this works
> int c IDENTITY_MACRO(IDENTITY_MACRO(COMMA_TOKEN))() d; // this
doesn't
>
>Basically, what's happening here is that function-like COMMA_TOKEN macro
>gets expanded _inside_ of the nested IDENTITY_MACRO call - even although
>it's NOT followed by a '(' as the next preprocessing token - which is a
>clearly an incorrect behavior (see 16.3 [cpp.replace] para 9 for the
>detailed description of the function-like macro replacement process). I
>haven't submitted bug report yet, but I am going to.
Whoever checks PREPROCESSOR into CVS, please make sure that a regression
test is added to root/status/regression.cfg so that the above bug is
illuminated.
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk