typechecking

Doug Schmidt schmidt at siam.ics.uci.edu
Thu Jan 12 08:03:57 AEST 1989


In article <9335 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
|>In article <19620 at uflorida.cis.ufl.EDU> thoth at banana.cis.ufl.edu () writes:
|>>fprintf("%s : line %d : colon expected.\n",filename,linenumber); 
|>>Turbo catches this and gcc doesn't.
|>
|>I'm somewhat surprised that GCC doesn't catch this, since the
|>correct prototype in <stdio.h> would be
|>	int fprintf(FILE *, const char *, ...);
|>and the compiler should be able to validate the first two argument types.

Unfortunately, most people don't change their standard #include files
when they install gcc.  On my sun, for example, fprintf isn't even
mentioned in /usr/include/stdio.h.  Therefore, gcc will only catch
this if a conscientious gcc installer has modified the standard
include files or changed cccp (the gnu cpp) to look in another
directory first.

Doug Schmidt
--
schmidt at ics.uci.edu (ARPA) |   Per me si va nella citta' dolente.
office: (714) 856-4043     |   Per me si va nell'eterno dolore.
                           |   Per me si va tra la perduta gente.
                           |   Lasciate ogni speranza o voi ch'entrate.



More information about the Comp.lang.c mailing list