Path: utzoo!attcan!uunet!decwrl!sgi!davea@quasar.wpd.sgi.com From: davea@quasar.wpd.sgi.com (David B. Anderson) Newsgroups: comp.sys.sgi Subject: Re: Another C bug? Keywords: C, MIPS, bug, void Message-ID: <65335@sgi.sgi.com> Date: 27 Jul 90 15:31:55 GMT References: <1990Jul26.200143.1625@midway.uchicago.edu> Sender: davea@quasar.wpd.sgi.com Reply-To: davea@quasar.UUCP (David B. Anderson) Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 27 In article <1990Jul26.200143.1625@midway.uchicago.edu> langer@rainbow.uchicago.edu (Steve langer) writes: > > I've been having trouble with the MIPS C compiler on a >Silicon Graphics 4D/220 (3.2). I think this is slightly different >than the (void *) bug that was discussed here recently. The No, really the same. >problem is that pointers to functions returning void aren't >treated properly. True in 3.2. >The following program doesn't compile if TYPE is defined to be >"void". It works if TYPE is defined to be "int". It compiles >(and works!) in both cases on a Sun. [stuff deleted] >ccom: Error: junk.c, line 13: operands of == have incompatible types > if(func == function) (*function)(); > ----------------------^ Neither void * _nor_ void work dependably in 3.2. The void type was assigned the same type tag as ``undefined'' internally in ccom, which lead to various peculiar error messages. The problems are fixed in 3.3. In 3.3 ccom ``void'' is assigned its own unique internal type tag. Regards. [ David B. Anderson Silicon Graphics (415)335-1548 davea@sgi.com ] [``What can go wrong?'' --Calvin and Hobbes]