home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.programming
- Path: sparky!uunet!utcsri!torn!watserv2.uwaterloo.ca!watserv1!mhcoffin
- From: mhcoffin@tolstoy.uwaterloo.ca (Michael Coffin)
- Subject: Re: Teaching the basics
- In-Reply-To: sdms@bnr.ca's message of 20 Aug 92 16:42:09 GMT
- Message-ID: <MHCOFFIN.92Aug20162507@tolstoy.uwaterloo.ca>
- Sender: news@watserv1.uwaterloo.ca
- Organization: Dept. of Computer Science, University of Waterloo
- References: <Bt6DGq.HuB@metropolis.com> <12635@anderson>
- <ratner.714247759@ficus.cs.ucla.edu> <13226@bnr-rsc.UUCP>
- Date: Thu, 20 Aug 1992 21:25:07 GMT
- Lines: 29
-
- In article <13226@bnr-rsc.UUCP> sdms@bnr.ca (Andrew Sterian) writes:
- > Hmmmm...I disagree on this one. It may have been true some years ago that
- > the type checking etc. of Pascal made it easier on novice programmers but
- > the latest ANSI C compilers do just as good a job of it as Pascal.
-
- I've heard this said with quite a bit of frequency lately, but it
- isn't true. C compilers---even ANSI ones---don't do type
- checking across separately compiled files. If I put the function
- prototype
-
- int f(double);
-
- in one file and call f(3.14), the compiler is happy. If I
- then put the function
-
- int f(int, char *) {... }
-
- in another file, the compiler won't complain about that either.
- And I don't know of any C linkers that will complain. If the
- programmer is lucky, the program will dump core; if not, who knows
- what may happen?
-
- It is true that if you use a certain amount of discipline and make
- sure that the same prototype appears in both places---by putting it in
- an include file---the compiler will detect the error. The problem is,
- there isn't any enforcement of this policy.
-
- -mike
-
-