Warning from cpp on macro argument stringification is missing

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Thu Sep 7 08:40:00 GMT 2000


 > From: Zack Weinberg <zack@wolery.cumb.org>
 > 
 > On Wed, Sep 06, 2000 at 11:29:01AM -0400, Kaveh R. Ghazi wrote:
 > > Zack,
 > > 
 > > There used to be a -Wtraditional warning from cpp on stringification
 > > of macro arguments.  It seems to have disappeared.
 > 
 > Right.  It got lost in the shuffle during the macro expander rewrite.
 > I've been meaning to fix it for some time, but the way things are
 > right now I doubt I'll get to it in the next few months!
 > 
 > But if you would like to patch it back in, I'd be happy to review.
 > zw


After the rewrite, the code no longer resembles anything like what it
was.  So I don't know where to plug in the warning.  It used to occur
in collect_expansion in cpphash.c (in 2.95), but this function no
longer exists in cpplib AFAICT.  It seems to mave been replaced by
save_expansion, but that's not quite the same.

I did see collect_expansion in tradcpp.c, but its more important to
get this warning when NOT in traditional mode.  So I want to find out
where in cpplib I might concentrate.

I looked in cpphash.c and cppmacro.c and didn't see the right place.

I suspect that since you ripped out the traditional stuff from cpplib,
that there is no place where you parse function macro specifically to
see if any strings in the replacement contains an argument of the
macro.  Is this true, or can you point out the function where this
magic happens?

		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions


More information about the Gcc-bugs mailing list