Path: utzoo!attcan!uunet!husc6!cca!g-rh From: g-rh@cca.CCA.COM (Richard Harter) Newsgroups: comp.lang.c Subject: Re: using standard interfaces Message-ID: <33391@cca.CCA.COM> Date: 16 Sep 88 07:22:52 GMT References: <485.231DAAC3@stjhmc.fidonet.org> <725@proxftl.UUCP> <7076@bloom-beacon.MIT.EDU> Reply-To: g-rh@CCA.CCA.COM (Richard Harter) Organization: Xerox Corporation, Cambridge, Massachusetts Lines: 25 In article <7076@bloom-beacon.MIT.EDU> scs@adam.pika.mit.edu (Steve Summit) writes: >The reason we keep pointing out the existence of standard >functions to those who would rather (or have to) roll their own >is to encourage people to start using the standard interface, by >writing their own function with the same name and parameters, >rather than sticking special-purpose code in-line, or inventing >some new name. This way the program can take advantage of >standardized, optimized implementations when they become >available (for instance when the program is ported to a different >system which has them). This sounds good, but there is a problem to take into account. If you have your own routine with the same name as the "standard" routine there is the potential for problems when you port into a system that has the "standard" routine in its library. The problem is that the library implementers may use said routine internally in the library in a way that conflicts with your routine. For example, it is quite unsafe to roll your own storage allocator and call it malloc. -- In the fields of Hell where the grass grows high Are the graves of dreams allowed to die. Richard Harter, SMDS Inc.