This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch]: Add push_macro/pop_macro feature for all targets by moving it from C frontent into libcpp
On 11/04/2009 05:25 PM, Tom Tromey wrote:
Kai> -static GTY((param_is (struct def_pragma_macro))) htab_t pushed_macro_table;
Do pushed macros work properly with PCH after this patch?
I don't think so. There is nothing that saves the state, so placing
--- test.h ---
#define FOO bar
#pragma push_macro("FOO")
#define FOO baz
--- test.c ---
#include "test.h"
#pragma pop_macro("FOO")
would fail because pop_macro would not find FOO on the stack. It is
extremely unlikely to happen in practice, but it is still a bug. You
need to modify libcpp/pch.c to fix this.
Paolo