From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,a723b6e5f6961330 X-Google-Attributes: gidfee84,public From: Akim Demaille Subject: Re: Bug in CC? (OSF1 4.0) Date: 1997/10/21 Message-ID: #1/1 X-Deja-AN: 284783090 References: Organization: ENST, France Newsgroups: comp.unix.osf.osf1 Akim Demaille writes: > Hi ! > > One of the problems I encounter is a weird behavior of native > cc. On the attached file (cc -E of the file giving problems), I get > the following problems: > > $ cc foo.c -c > cc: Error: foo.c, line 534: In this declaration, the type of > "ds_strccat" is not compatible with the type of a previous declaration > of "ds_strccat" at line number 339 in file foo.c. > ds_strccat (struct dstring *s, char c) > ^ > > The line 534 is > void /* 533 */ > ds_strccat (struct dstring *s, char c) > > and 339 is > > void ds_strccat (); Several persons answered my question. I thank them a lot, and apologize for my mistake. Weirdness was purely due to my miscomprehension of mixed KnR and ANSI style. Everything comes from the fact that : - my does-the-compiler-handle-prototypes macros were ill defined, removing prototypes to often, - I thought there were no problems with that. It appears that only two functions in the file I sent were using char as parameters, but leaving undefined the arguments in the prototype resulted in having them defaulted to an int type. It breaks on char (and short int, floats I guess, etc.). Any compiler would have behaved this way. To fix my problem I only had to fix my prototypes defining macros so that they... work :). Once again, thanks a lot to those who answered. Akim PS/ I have a question then: how would a KnR compiler would have behaved? -- P-mail: Akim Demaille, 107 rue Bobillot, F-75013 Paris, France E-mail: demaille@inf.enst.fr V-mail: +33 (1) 45-81-78-68