Another C bug?
David B. Anderson
davea at quasar.wpd.sgi.com
Sat Jul 28 01:31:55 AEST 1990
In article <1990Jul26.200143.1625 at midway.uchicago.edu> langer at 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 at sgi.com ]
[``What can go wrong?'' --Calvin and Hobbes]
More information about the Comp.sys.sgi
mailing list