Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Efficient STRing CoMPares? Message-ID: <15537@smoke.brl.mil> Date: 21 Mar 91 00:55:09 GMT Article-I.D.: smoke.15537 References: <1193@caslon.cs.arizona.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 21 In article marc@arnor.UUCP (Marc Auslander) writes: >A correct compiler cannot inline strcmp unless it is given >extralingual permission to do so - for example in a pragma or by >defining some reserved symbol or by some other means. This is because >it is legal to combine a program which uses strcmp with another which >defines it to by anything at all! Conforming implementations ARE allowed to in-line the standard library functions. They must also provide external functions for most of them, in case some application decides it needs a pointer to one of those functions, etc. It is true that a strictly conforming program is allowed to #define strcmp, under certain circumstances, but that is not an issue. It is the use of "strcmp" as an identifier with external linkage that an in-lining compiler must key on. It is also possible for to #define strcmp __strcmp and have the compiler in-line __strcmp instead of strcmp. This may make it slightly easier for the implementation to support access to the external-function definition of strcmp mentioned in my first paragraph.