This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch to poison (or wrap with !IN_GCC?) ansidecl.h macros


 > From: Zack Weinberg <zack@codesourcery.com>
 > 
 > "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:
 > 
 > > This patch ensures we don't regress into reusing the ansidecl.h macros
 > > for K&R compatibility.  The two major macros (PARAMS and PTR) probably
 > > can't go in here even after they're all cleaned out because they're
 > > used in the libiberty headers which we include all over the place.
 > > Nevertheless at least these won't come back.
 > >
 > > I came up with two approaches.  One was poisoning the macros, which
 > > I've included below.  The other would be to move the macros within
 > > ansidecl.h into the !IN_GCC clause where we store other obsoleted
 > > macros we don't want to use.  (Look in ansidecl.h to see what I mean.)
 > 
 > I think we can't modify ansidecl.h without consultation with other
 > projects that use it.  Other opinions?
 > zw

Well, if we're guarding stuff with !IN_GCC, then other projects will
be oblivious to what we do.

However, now I'm thinking that never defining the macros at all is
blocking them too early for GCC's needs.  (E.g. libiberty.h checks the
ANSI_PROTOTYPES macro from ansidecl.h.)  So we need at least this
defined early on.  Undef'ing and poisoning after libiberty.h has been
included works fine.

So I prefer the original patch as posted.  Sorry for obfuscating the
issue.  Would you please review the prior patch?

		Thanks,
		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]