Xref: utzoo comp.sys.mips:216 comp.sys.sgi:2168 comp.sys.dec:1957 Path: utzoo!attcan!telly!lethe!torsqnt!jarvis.csri.toronto.edu!mailrus!cornell!calvin!johns From: johns@calvin.EE.CORNELL.EDU (John Sahr) Newsgroups: comp.sys.mips,comp.sys.sgi,comp.sys.dec Subject: bug in ds3100 cc? Message-ID: <1333@calvin.EE.CORNELL.EDU> Date: 22 Sep 89 16:43:01 GMT References: <6833@pixar.UUCP> Reply-To: johns@calvin.spp.cornell.edu.UUCP (John Sahr) Organization: Cornell Space Plasma Physics Group Lines: 41 I have run across a bug in the MIPS cc C compiler (or in my understanding). Consider the following. #include int test(void *b) { printf("%d\n", *((int *) b)); return 0; } int main() { int four = 4; return test((void *) &four); } On a microvax (2000, ultrix) vcc and gcc (1.34) compile this and the result runs fine. vax cc objects, though (not surprising to me). On a DS3100, cc objects to the printf("%d\n", *((int *) b)), saying that b is undefined. Putting a prototype before test() does not help, and making typedef void *anonymous; to replace the void * doesn't help either. Any comments? The MIPS cc seems to handle the new style declarations pretty well, except for this. int test(b) void *b; { .... } Neither uvax lint nor MIPS lint approve of this declaration "b may be used before set..." among other things. Does this all mean that the "MIPS cc does not know about `void *' as `anonymous ptr'?" -john -- John Sahr, Dept. of Electrical Eng., Cornell University, Ithaca, NY 14853 johns@{alfven,calvin}.ee.cornell.edu, {rochester,cmcl2}!cornell!calvin!johns --When the dust settles, each B2 bomber will fund NSF for more than a year--