[7287] in Athena Bugs

home help back first fref pref prev next nref lref last post

rt 7.2R: hc2.1y

daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Tue Mar 12 13:24:08 1991

Date: Tue, 12 Mar 91 13:23:44 EST
From: John T Kohl <jtkohl@MIT.EDU>
To: bugs@MIT.EDU

System name:		soup
Type and version:	RTPC-ROMPC 7.2R
Display type:		apa16

What were you trying to do?
	Compile some ISODE code.

What's wrong:
	The compiler barfs on a legitimate cast.  Both the pmax
cc1.31 and VAX PCC can compile it without complaint.

I boiled this problem down to this fragment:

typedef struct	{
	int	pe_type;	/* Type of entry */
}	tpe;
#define NULLTPE	((tpe *)0)

typedef struct	{
	int	pe_type;	/* Type of entry */
}	ptpe;
#define NULLPTPE	((ptpe *)0)

typedef	struct	{
	ptpe    **md_ptab;	/* Pointer to printing tables */
	}	modtyp;
#define NULLMODTYP	((modtyp *)0)

void
dmp_tpe(mod)
modtyp *mod;
{
    tpe **parq;
    ((ptpe **)parq) = mod->md_ptab;
    (ptpe **)parq = mod->md_ptab;
}


The errors it generates:

% hc -v -c broken-hc.c
/lib/cpp -D__STDC__ -D__HIGHC__ broken-hc.c /tmp/pp.014283
/usr/lib/hc1com /tmp/pp.014283 -efile @E -silent -on CHAR_DEFAULT_UNSIGNED -offDOUBLE_MATH_ONLY -on DOUBLE_RETURN -on LONG_ENUMS -off PCC -on PCC_MSGS -ofile /tmp/IL1014283 -vfile /tmp/var014283 -machine rtfl -define ibm032 1 -pro hc.pro -copyr -dir /usr/include
MetaWare High C Compiler R2.1y
(c) Copyright 1987-89, MetaWare Incorporated

E "broken-hc.c",L22/C19:        (syntactic)  unexpected symbol:'='
REPAIR:   ';' replaces '='@"broken-hc.c",L22/C19
1 user error   No warnings
Exit 8               hc -v -c broken-hc.c

-------
Note that line 21 works fine, but line 22 fails.

What should have happened:
	The compiler shouldn't gratuitously fail.

Please describe any relevant documentation references:
	X3.159


home help back first fref pref prev next nref lref last post