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: PR 17408/17409


On Sep 10, 2004, at 2:52 PM, Joseph S. Myers wrote:
On Fri, 10 Sep 2004, Dale Johannesen wrote:

It seems DECL_EXTERN is getting set for declarations of the form
  extern int foo = init;
which is contrary to the description in tree.h, and causes the
problems in these PRs.  Still testing, but this looks fairly obvious;
OK if test cycle works?

So, as I asked in bug 17408, does this patch keep gcc.dg/pr15360-1.c working? That is the only case likely to be a problem.

Indeed, my patch breaks that test.
Having now read what the standard requires (which seems poorly chosen,
but it's Too Late Now), getting all cases right seems messy. Setting
DECL_EXTERN on an initialized object obviously leads to trouble, and
is contrary to the meaning of that flag. I'm now thinking in terms of
adding a bit, which tells whether an initialized object was defined using
'extern' or not. The code that resolves


static int x;
? int x = 3;

looks at that bit to do the right thing. Comments?


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