Wolfram Gloger <[EMAIL PROTECTED]> wrote:
> 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.
It may well be an ANSI violation for this to work, but we all know
that many compilers do not always follow the ANSI guidelines as much
as we would like. Portability work is about making sure the code
works with all compilers, more so than following the ANSI standard
;-).
> > 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.]
Sure, it may be a workaround but we can't compile the code without it.
> And your examples for `badly used token pasting' and `rampant
> problems' in the sources were ?
The token pasting problem was in several places in the code, and we
have fixed that in our copies. As for the warnings, compiling Mesa
with our regular warning level (quite high, but we do it for
portability) produces 100's of warnings during the compilation of the
code. This is with both Watcom C++ 10.6 and 11.0b. I have not tried
it with GNU C under DOS, nor Visual C++ at this stage. However if I
get so many warnings with Watcom C++, I know Visual C++ will have a
fit because it usually complains about stuff Watcom C++ does not.
What seems strange to me is that Watcom C++ is (in my experience) a
compiler that generates the *least* warnings. In fact I just tried
passing our code through Borland C++ and Visual C++, and both spat
out huge amounts of compiler warnings (although they only got about
three files into the compilation before stopping, but that is
something we have done). I did give GNU C a quick try, and as I
expected I got no warnings with -Wall (and I used to think GNU C was
picky).
Regards,
+---------------------------------------------------------------+
| SciTech Software - Building Truly Plug'n'Play Software! |
+---------------------------------------------------------------+
| Kendall Bennett | Email: [EMAIL PROTECTED] |
| Director of Engineering | Phone: (530) 894 8400 |
| SciTech Software, Inc. | Fax : (530) 894 9069 |
| 505 Wall Street | ftp : ftp.scitechsoft.com |
| Chico, CA 95928, USA | www : http://www.scitechsoft.com |
+---------------------------------------------------------------+
_______________________________________________
Mesa-dev maillist - [EMAIL PROTECTED]
http://lists.mesa3d.org/mailman/listinfo/mesa-dev