From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200104281106.NAA20008@copernicus.cs.utwente.nl> To: 9fans@cse.psu.edu Subject: Re: [9fans] pcc problem compiling assumed to be correct C file In-reply-to: Your message of "Fri, 27 Apr 2001 16:37:12 +0100." <20010427153636.36AA91998A@mail.cse.psu.edu> References: <20010427153636.36AA91998A@mail.cse.psu.edu> From: Axel Belinfante MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20004.988456012.1@copernicus.cs.utwente.nl> Date: Sat, 28 Apr 2001 13:06:53 +0200 Topicbox-Message-UUID: 95f3a4f0-eac9-11e9-9e20-41e7f4b1d025 > no, it shouldn't. it's the first bug i've seen in the port part > of the compiler for some time. it's cc/dcl.c:/^mkstatic I tried two solutions suggested by forsyth in private mail. 1 changing mkstatic to generate unique symbol names 2 changing block to be of ushort instead of char Unfortunately I tried 1) at work and 2) at home, in slightly different ways. Having just successfully applied 2) and having to email from linux and already having rebooted linux I did not want to go back to plan9 to retry 1) in exactely the same way as the succesfull 2). 1) did succeed to compile the code, but the result committed suicide. It did _not_ commit suicide when I just run it to print a version number, but _did_ suicide when those static variables where initialised. The suicide could also be explained by the fact that I tried to combine ape-'mode' source with a plan9 yacc-generated y.tab.c and therefore had to fiddle with fprint and sprint not being available in ape (I did not think in time of -Dalloca=malloc) 2) succeeded and also the result works To be sure I also changed sueblock, because I had the impression of seeing some assignments from block, I think. however, here I used bison-generated y.tab.c and used -Dalloca=malloc diff of the change follows. diff Old/cc.h ./cc.h 83,84c83,84 < char block; < char sueblock; --- > ushort block; // was char > ushort sueblock; // was char 100c100 < char block; --- > ushort block; // was char diff Old/dcl.c ./dcl.c 117c117 < snprint(symb, NSYMB, "%s$%d", s->name, (char)s->block); --- > snprint(symb, NSYMB, "%s$%d", s->name, (ushort)s->block); // was (char) Regards, Axel (who still very much wants his plan9 ppp to (finally?) work :-/