User-namespace pre#defines - new approach
Zack Weinberg
zack@codesourcery.com
Mon Apr 15 12:48:00 GMT 2002
On Mon, Apr 15, 2002 at 03:06:54PM -0400, Christopher Faylor wrote:
>
> We don't have an option as far as Windows is concerned. We really do
> need to define WINNT, _cdecl, and _stdcall if we want to continue
> to build Windows apps.
This conflicts with the sanity check I put in gcc.c to prevent specs
from defining any user-namespace macros at all. VxWorks also has
problems with this -- since I'm in the middle of updating that GCC
port anyway I was just going to fix their headers, but we don't have
that option with Windows.
I'm now thinking that a different approach would be better. Suppose I
add a new command line option (--deprecated-macro, say; it needn't be
short) to cpplib, and change most of the existing -D[A-Za-z] instances
to use it instead. The effect of --deprecated-macro FOO is to cause
cpplib to define FOO, __FOO, and __FOO__; FOO gets left out if
-ansi/-std=c*, and if it is defined, using it generates a warning.
This (a) leaves specs free to define user-namespace macros if they
have no choice; (b) should be easier to validate the patch; (c) still
allows us to get rid of the %{!ansi:%{!std=c*:...yadda...}} nonsense
in a lot of specs, often incorrectly, and the %p/%P nonsense in gcc.c;
(d) offers a gentler transition than the original patch.
Reactions?
zw
More information about the Gcc-bugs
mailing list