[net.unix-wizards] The incredible exploding C compiler.

darrell@sdcsvax.UUCP (Darrell Long) (02/04/86)

Oh great and wise UNIX* wizards, I again appeal to your wisdom.  The C
compiler on my 3B-2 says,

	cc -O -c hack.mklev.c
"hack.mklev.c", line 477: compiler error: dlabel

The offending line(s) follow.

	croom = &rooms[a];
	troom = &rooms[b];

	/* find positions cc and tt for doors in croom and troom
	   and direction for a corridor between them */

	if(troom->hx < 0 || croom->hx < 0 || doorindex >= DOORMAX) return;
	if(troom->lx > croom->hx) {
		dx = 1;
		dy = 0;
		xx = croom->hx+1;
		tx = troom->lx-1;
		cc = finddpos(xx,croom->ly,xx,croom->hy);
		tt = finddpos(tx,troom->ly,tx,troom->hy);
	} else if(troom->hy < croom->ly) {
	.
	.
	.

Does anyone know what this error means?  Is it a known bug that can be
programmed "around"?

--
*UNIX is a trademark of Bell Labs and all that...
-- 
Darrell Long
Department of Electrical Engineering and Computer Science
University of California, San Diego

UUCP: sdcsvax!darrell
ARPA: darrell@sdcsvax

rich@rexago1.UUCP (K. Richard Magill) (02/05/86)

In article <1377@sdcsvax.UUCP> darrell@sdcsvax.UUCP (Darrell Long) writes:
>Oh great and wise UNIX* wizards, I again appeal to your wisdom.  The C
>compiler on my 3B-2 says,
>
>	cc -O -c hack.mklev.c
>"hack.mklev.c", line 477: compiler error: dlabel

While we're at it.  When it does compile it garbages the screen when you
try to throw things.  I mention it here and not on net.games.foo because
the SAME SOURCE on a pc7300 works nicely. (both SV)

BTW, scame has a similar problem.  query-replace prints garbage instead of
prompts on the 3b2.  pc7300 version is pretty.

K. Richard Magill

todd@bucsd.UUCP (Todd Cooper) (02/05/86)

In article <1377@sdcsvax.UUCP> darrell@sdcsvax.UUCP (Darrell Long) writes:
>Oh great and wise UNIX* wizards, I again appeal to your wisdom.  The C
>compiler on my 3B-2 says,
>
>	cc -O -c hack.mklev.c
>"hack.mklev.c", line 477: compiler error: dlabel
>
>The offending line(s) follow.
>
>	croom = &rooms[a];
>	troom = &rooms[b];
>
>	/* find positions cc and tt for doors in croom and troom
>	   and direction for a corridor between them */
>
>	if(troom->hx < 0 || croom->hx < 0 || doorindex >= DOORMAX) return;
>	if(troom->lx > croom->hx) {
>		dx = 1;
>		dy = 0;
>		xx = croom->hx+1;
>		tx = troom->lx-1;
>		cc = finddpos(xx,croom->ly,xx,croom->hy);
>		tt = finddpos(tx,troom->ly,tx,troom->hy);
>	} else if(troom->hy < croom->ly) {
>	.
>	.
>	.
>
>Does anyone know what this error means?  Is it a known bug that can be
>programmed "around"?
>

I Programmed around it (on our 3b5) by doing a #define for &rooms[a]
and it worked --- it put the right things in the right places -- anything
in C can be worked around if one is tricky enough --- BOY WOULD I LIKE
TO YELL AT SOMEONE AT AT&T FOR A *COMPILER* ERROR!.

Now that it is off my head -- if you want context diffs -- please tell me
(or an image file)

-- 
---------------------------
Todd Cooper

UUCP:	...!harvard!bu-cs!todd ...!harvard!think!festiv!todd
CSNET:	todd@bu-cs
BITNET:	cscpyqc@bostonu
USNail:	29 Gordon Street #201, Brighton, MA 02135

djl@gitpyr.UUCP (02/06/86)

Okay, I just spent a few hours fiddling with this exact same problem on one
of our 3B2s.  The problem lies with the fact that, as distributed, hack 
expects chars to be signed.  There are comments in config.h about this. if
chars on your machine are unsigned, as on the 3B2, then you have to change
the typedef for schar (in config.h) to "short int" instead of "char".

just in case you care, the message comes from /lib/comp (even the dlabel part)
which is the workhorse part of the c compiler on the 3B2.

Dave Lane, User Assistant, Office of Computing Services,
Georgia Institute of Technology, Atlanta, Georgia  30332

...!{akgua,allegra,amd,hplabs,ihnp4,masscomp}!gatech!gitpyr!djl
...!{rlgvax,sb1,uf-cgrl,unmvax,ut-sally,ut-ngp}!gatech!gitpyr!djl
-- 
Dave Lane, User Assistant, Office of Computing Services,
Georgia Institute of Technology, Atlanta, Georgia  30332

...!{akgua,allegra,amd,hplabs,ihnp4,masscomp}!gatech!gitpyr!djl
...!{rlgvax,sb1,uf-cgrl,unmvax,ut-sally,ut-ngp}!gatech!gitpyr!djl

djl@gitpyr.UUCP (Dave Lane) (02/06/86)

Okay, I just spent a few hours fiddling with this exact same problem on one
of our 3B2s.  The problem lies with the fact that, as distributed, hack 
expects chars to be signed.  There are comments in config.h about this. if
chars on your machine are unsigned, as on the 3B2, then you have to change
the typedef for schar (in config.h) to "short int" instead of "char".

just in case you care, the message comes from /lib/comp (even the dlabel part)
which is the workhorse part of the c compiler on the 3B2.

Dave Lane
-- 
Dave Lane, User Assistant, Office of Computing Services,
Georgia Institute of Technology, Atlanta, Georgia  30332

...!{akgua,allegra,amd,hplabs,ihnp4,masscomp}!gatech!gitpyr!djl
...!{rlgvax,sb1,uf-cgrl,unmvax,ut-sally,ut-ngp}!gatech!gitpyr!djl