Waldek Hebisch wrote:
I tried the following:
diff -ru gpc-20040516.orig/p/declarations.c gpc-20040516/p/declarations.c --- gpc-20040516.orig/p/declarations.c Wed May 12 02:39:11 2004 +++ gpc-20040516/p/declarations.c Thu Jul 8 13:03:15 2004 @@ -3079,8 +3079,12 @@ DECL_REGISTER (d) = !!(qualifiers & VQ_REGISTER); PASCAL_DECL_TYPED_CONST (d) = !!(qualifiers & VQ_BP_CONST); TREE_STATIC (d) = !!(qualifiers & VQ_STATIC);
if (TREE_STATIC (d))
DECL_CONTEXT (d) = 0;
Unfortunately, pushdecl() (further below) overrides DECL_CONTEXT, so your patch is ineffective. (Of course, you couldn't notice this, since the problem doesn't arise under Linux.)
The enclosed patch should fix it. (You can undo the previous work-around.)
There was also an obstack problem (gcc-2.x). Maybe that's what I had missed last time I tried it.
But still, consider this patch with caution. I've verified that it doesn't break under Linux/IA32 (gcc-2.8.1, 2.95.3 and 3.3.3) and DJGPP (2.8.1), and fixes the problem under AIX.
I'll test it on more systems when I get to it, but if anyone else can check that it doesn't break (and possibly fix) anything on other systems, this will be appreciated.
Frank