9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Axel Belinfante <Axel.Belinfante@cs.utwente.nl>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] pcc problem compiling assumed to be correct C file
Date: Sat, 28 Apr 2001 13:06:53 +0200	[thread overview]
Message-ID: <200104281106.NAA20008@copernicus.cs.utwente.nl> (raw)
In-Reply-To: Your message of "Fri, 27 Apr 2001 16:37:12 +0100." <20010427153636.36AA91998A@mail.cse.psu.edu>

> 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 :-/


  reply	other threads:[~2001-04-28 11:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-27 15:37 forsyth
2001-04-28 11:06 ` Axel Belinfante [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-04-30 19:25 rob pike
2001-04-27 10:04 Axel Belinfante
2001-04-27 15:00 ` Douglas A. Gwyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200104281106.NAA20008@copernicus.cs.utwente.nl \
    --to=axel.belinfante@cs.utwente.nl \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).