Path: utzoo!attcan!uunet!mcsun!ukc!edcastle!sjin From: sjin@castle.ed.ac.uk (S.Jin) Newsgroups: comp.sys.sgi Subject: Another C compiler bug? Message-ID: <5193@castle.ed.ac.uk> Date: 17 Jul 90 09:21:20 GMT Reply-To: sjin@castle.ed.ac.uk (S.Jin) Organization: Edinburgh University Computing Service Lines: 33 Is it a bug or not? I can compile the piece of program below successfully on Sun 3/60(4.0_Export), HP900/825(7.00). But I failed to do that on 4D 20 under IRIX 3.2. The program: struct Alist_Entry { void *slot; } ; main() { register struct Alist_Entry *ap; *( (int *) (ap->slot) ) = 11; *((char *)(ap->slot)) = 'a'; } The result on 4D 20 under IRIX 3.2: $ cc foo.c /* Suppose the program name as foo.c */ ccom: Error: foo.c, line 8: slot undefined *( (int *) (ap->slot) ) = 11; ---------------------^ ccom: Error: foo.c, line 8: member of structure or union required *( (int *) (ap->slot) ) = 11; ---------------------^ ccom: Error: foo.c, line 9: member of structure or union required *((char *)(ap->slot)) = 'a'; --------------------^ $ Is it a bug? Any comments are welcome. S. Jin