home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / std / c / 2548 < prev    next >
Encoding:
Text File  |  1992-09-01  |  2.1 KB  |  46 lines

  1. Newsgroups: comp.std.c
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!think.com!spdcc!dirtydog.ima.isc.com!karl
  3. From: karl@ima.isc.com (Karl Heuer)
  4. Subject: Re: Small Language Wanted
  5. Message-ID: <1992Sep01.195232.4678@ima.isc.com>
  6. Sender: usenet@ima.isc.com (news)
  7. Organization: Interactive Systems, Cambridge, MA 02138-5302
  8. References: <BURLEY.92Aug29143538@geech.gnu.ai.mit.edu> <9224317.28165@mulga.cs.mu.OZ.AU> <1992Sep1.130600.25488@siia.mv.com>
  9. Date: Tue, 01 Sep 1992 19:52:32 GMT
  10. Lines: 34
  11.  
  12. [I have removed comp.lang.fortran from the newsgroup list]
  13.  
  14. In article <1992Sep1.130600.25488@siia.mv.com> drd@siia.mv.com (David Dick) writes:
  15. >In article <9224317.28165@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
  16. >>Note that it makes sense to prevent users from redefining standard
  17. >>library functions, because doing so could have all sorts of undesireable
  18. >>side-effects.  [Example deleted]
  19. >
  20. >The fact that programmers who know what they're doing could no longer
  21. >replace pieces of the libraries for debugging or *performance* reasons,
  22. >was apparently of no consequence.
  23. >
  24. >IMHO, the "safety" provided by this reservation is far outweighed by
  25. >the crippling of standard programming practice.
  26.  
  27. The Standardization of C had absolutely no effect on this aspect of the
  28. language.
  29.  
  30. In Classic C, if you override a library function by a user-written function
  31. of the same name, you get the expected results if you're "lucky", or if you
  32. know enough about the implementation details to understand that it's safe.
  33. The resulting program is not portable to an environment where the
  34. implementation details are different.
  35.  
  36. In ANSI C, if you override a library function by a user-written function of
  37. the same name, you have violated a constraint; hence you get the expected
  38. results if you're "lucky", or if you know enough about the implementation
  39. details to understand that it's safe.  The resulting program is not portable
  40. to an environment where the implementation details are different.
  41.  
  42. The difference is that ANSI C explicitly documented something where Classic C
  43. programmers had to rely on common sense.
  44.  
  45. Karl W. Z. Heuer (karl@ima.isc.com or uunet!ima!karl), The Walking Lint
  46.