Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!vsi1!steve From: steve@vicom.com (Steve Maurer) Newsgroups: comp.sys.sgi Subject: Outright bug in the SGI C compiler... Summary: The SGI C compiler doesn't allow procedure equates. Keywords: bug, C, support Message-ID: <1989Nov27.234730.25669@vicom.com> Date: 27 Nov 89 23:47:30 GMT Sender: steve@vicom.COM (Steve Maurer) Reply-To: steve@vicom.COM (Steve Maurer) Organization: Vicom Systems Inc. San Jose, Cal. Lines: 49 While trying to polish off the ends of a project, I ended up having to do a work-around for a mutual design deficiency between our product and the SGI compiler. However, on the work around itself, I found another, much less forgivable bug in the SGI compiler; an outright violation of the C standard. While the compiler allows pointers to functions to be assigned, it does not allow them to be compared. It also doesn't allow them to be cast to allow comparison. The following example illustrates the problem. It was checked out on a number of other C compilers (Sun being the main one), and it compiled and performs flawlessly. But not on the SGI. - - - - - - - - - - - - - - - - - - - - - - - - void foo(), bar(); main() { void (*pfn)(); pfn = foo; /* SGI compiler allows this */ if ( pfn == foo ) /* but barfs on this */ printf("Pfn calls foo\n"); else printf("Pfn calls bar\n"); } void foo() { } void bar() { } - - - - - - - - - - - - - - - - - - - - - - - - My question is: does anybody know a work around for this flaw? Is there a new release fix for it? If that's the case, I need the new stuff immediately, since the project I'm working on is already way behind. Steve Maurer steve@vicom.com