home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!wupost!waikato.ac.nz!aukuni.ac.nz!ecmtwhk
- Newsgroups: comp.programming
- Subject: Re: ANSI C, was Re: Teaching the basics
- Message-ID: <1992Aug23.021756.21237@ccu1.aukuni.ac.nz>
- From: ecmtwhk@ccu1.aukuni.ac.nz (Thomas Koenig)
- Date: Sun, 23 Aug 1992 02:17:56 GMT
- References: <1992Aug22.113219.4821@prl.dec.com>
- Organization: University of Auckland, New Zealand.
- Lines: 25
-
- boyd@prl.dec.com (Boyd Roberts) writes:
-
- >Prototypes are cheap hack, and they can lie, whereas the actual
- >function declaration specifies it exactly. The protypes just say that the
- >calls agree with the prototypes, and that's not the same as the actual
- >declaration.
-
- >Putting extra info in the object would be a total win. Why should I go to
- >declare my functions twice, when the machine can do that stuff for me?
-
- Prototypes are at least better than nothing, if you enforce their use.
- ANSI-C really could not do much better without breaking all existing C
- program up to that date. If you have declared your header dependencies
- in your makefile correctly, you should not have any problem.
-
- Actually, I like the Modula-2 concept much better: Put definitions
- (declarations, in C usage) into separate files and let the compiler barf
- if use or implementation (definition, in C usage) do not agree with
- these. Finally, let the linker check wether the compiled definition and
- implementation modules actually belong together. A pity Modula-2 does
- not have either decent or portable I/O libraries...
- --
- Thomas Koenig, ecmtwhk@ccu1.aukuni.ac.nz, ib09@rz.uni-karlsruhe.de
- The joy of engineering is to find a straight line on a double logarithmic
- diagram.
-