> Specifically we are building the code using 
> the Watcom C++ 11.0 compiler, and are running into problems with 
> badly used token pasting and compiler warnings all over the place. Is 
> anyone actually building the latest CVS sources on a regular basis 
> with compilers other than GNU C on Linux? I certainly didn't expect 
> to see these types of problems rampant throughout the latest CVS 
> sources.
> 
> The problem with token pasting is simple to fix. The code is 
> currently constructed like so:
> 
> #define TAB(x)   blah_blah_##x##_table
> 
> and used like so:
> 
>  TAB(4ub);
> 
> The problem with this is that the '4ub' value passed to the macro is 
> interpeted by many compilers as the unsigned value 4 followed by the 
> character b.

Huh ?  If this really happens, it is an obvious, and rather horrible
preprocessor bug.  `4ub' _must_ be parsed as a single preprocessor
number token (although it is not a valid integer constant token).  See
the ANSI C standard 6.1.8.

> The solution to this problem (and what we do in our code 
> where we do this type of thing) is to always use an underscore in 
> front of the names passed to macros that use token pasting:

This is no solution, it's a workaround for a buggy preprocessor.
[Note: I'm not opposed against applying such a change, but the
reasoning should be clear.]

And your examples for `badly used token pasting' and `rampant
problems' in the sources were ?

Regards,
Wolfram.
-- 
`Surf the sea, not double-u three...'
[EMAIL PROTECTED]


_______________________________________________
Mesa-dev maillist  -  [EMAIL PROTECTED]
http://lists.mesa3d.org/mailman/listinfo/mesa-dev

Reply via email to