This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: cpp -traditional, *Initialization*:1: warning: "__mips" redefined
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: cpp -traditional, *Initialization*:1: warning: "__mips" redefined
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Sat, 26 Aug 2000 09:38:52 -0700
- Cc: gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- References: <200008261339.JAA19417@caip.rutgers.edu>
On Sat, Aug 26, 2000 at 09:39:00AM -0400, Kaveh R. Ghazi wrote:
> Zack,
>
> All of the -traditional tests are failing on mips-sgi-irix6.2.
> See: http://gcc.gnu.org/ml/gcc-testresults/2000-08/msg00214.html
> that's recent, but I believe this problem has been around for a while,
> perhaps as long as the separate traditional preprocessor was added.
...
> > % gcc -U__unix -D__unix=3 -traditional -c f.c
> > *Initialization*:1: warning: "__unix" redefined
Looks like the traditional preprocessor does all the -D switches and
then goes back and does all the -U switches. We want them
interleaved.
Please try this patch.
zw
* tradcpp.c (main): Process -D and -U at the same time.
===================================================================
Index: tradcpp.c
--- tradcpp.c 2000/08/04 12:45:57 1.10
+++ tradcpp.c 2000/08/26 16:37:17
@@ -711,14 +711,11 @@ main (argc, argv)
and option processing. */
initialize_builtins ();
- /* Do defines specified with -D. */
+ /* Do defines specified with -D and undefines specified with -U. */
for (i = 1; i < argc; i++)
if (pend_defs[i])
make_definition ((U_CHAR *)pend_defs[i]);
-
- /* Do undefines specified with -U. */
- for (i = 1; i < argc; i++)
- if (pend_undefs[i])
+ else if (pend_undefs[i])
make_undef ((U_CHAR *)pend_undefs[i]);
/* Unless -fnostdinc,