Xref: utzoo comp.unix.questions:16630 comp.lang.c:22356 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!uunet!mitel!sce!asterix!jimp From: jimp@asterix.UUCP (Jim Patterson) Newsgroups: comp.unix.questions,comp.lang.c Subject: Re: 'cc' versus 'gcc' Keywords: cc,gcc Message-ID: <7158@asterix.UUCP> Date: 27 Sep 89 18:13:38 GMT References: <506@shuldig.Huji.Ac.IL> Reply-To: jimp@cognos.UUCP (Jim Patterson) Followup-To: comp.unix.questions Organization: Cognos Inc., Ottawa, Canada Lines: 31 In article <506@shuldig.Huji.Ac.IL> misha%shum.huji.ac.il@CUNYVM.CUNY.EDU writes: > I have recently discovered a 'gcc' compiler on our system. >When I began using it, it appeared that the code runs now much faster >than the one produced by the standard 'cc'. ... >I would like to ask whether you have encountered any bugs, We tried out gcc on our system (Sun 3's), and never encountered what could be called a 'bug'. (If you have different hardware, this experience may not relate). We did encounter a few differences between calling conventions of gcc and those of Sun's compiler. These are relevant only if you mix the two languages. The differences that we encountered (there are likely others) are: - A function declared as returning float actually returns a float with gcc. cc promotes the float to double. Both are consistent with the ANSI draft standard. The only time this causes problems are: if an external reference declares a function float but the declaration is actually double (works with cc, not with gcc); or the function is declared float, and the implementation is compiled with cc but the caller compiles with gcc. - Struct alignments. gcc will allocate a struct containing a single byte (or 8 bits or less of bit-fields) to be 1 byte long. cc allocates a minimum of 2 bytes for any struct. -- Jim Patterson Cognos Incorporated UUCP:decvax!utzoo!dciem!nrcaer!cognos!jimp P.O. BOX 9707 PHONE:(613)738-1440 3755 Riverside Drive Ottawa, Ont K1G 3Z4