Actually I had my original K&R in hand when I answered the question. 
Before DEC C was allowed to become the compiler on Digital Unix, it 
had to successfully compile the entire kernel, libraries and commands. 
Most of the kernel at that time was K&R. Most of libc was ANSI, and the 
commands were a hodgepodge depending on their origin. Chris Gillett 
was the DUDE guy who was responsible for overseeing that effort. But, 
strcmp still returned and int back then. The issues are exactly what are 
the positive and negative values. ANSI says that strcmp() returns greater 
than zero, less than zero or zero. Most implementations return the 
difference between the first non-matching characters of the strings. While 
optimizing compilers may inline the code, the run time libraries frequently 
do a simple subtract. 
 
On 5 Apr 2000, at 14:42, Jon 'maddog' Hall, Executive Director, Li wrote:

> 
> [EMAIL PROTECTED] said:
> > The return values for as well as the arguments for strcmp() are
> > defined by  the ANSI  and ISO specifications.
> 
> And that is wonderful for ANSI and ISO compliant compilers.  But is was a long
> time coming that those august bodies even looked at our little operating
> system called "Unix" or Dennis' "C" compiler, and longer still before the
> various compilers supported those standards.
> 
> I have two copies of K&R, one is the original (signed by DR), and the other
> is "the new edition, supporting ANSI standards".
> 
> I also remember that one reason why DEC "C" sold so well...when you turned on
> the "ANSI" flag, you got ANSI "C"....and ONLY ANSI "C".
> 
> Ken Olsen would love it.
> 
> mad "and old" dog
> -- 
> =============================================================================
> Jon "maddog" Hall
> Executive Director, Linux(R) Intern'l    Director of Linux Evangelism         
> 
> Linux International                      VA Linux Systems                         
> 80 Amherst St.                           1382 Bordeaux Ave.
> Amherst, N.H. 03031-3032 U.S.A.          Sunnyvale, CA 94089
> Internet: [EMAIL PROTECTED]                  [EMAIL PROTECTED]
> WWW: http://www.li.org                   WWW: http://www.valinux.com              
> Voice: +1.603.672.4557
> 
> Board Member: Uniforum Association, USENIX Association
> 
> (R)Linux is a registered trademark of Linus Torvalds in several countries.


Jerry Feldman <[EMAIL PROTECTED]>
Associate Director
Boston Linux and Unix user group
http://www.blu.org

**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************
  • strcmp() Jerry Eckert
    • Re: strcmp... Farrell Woods
      • Re: st... Jon 'maddog' Hall, Executive Director, Linux International
        • Re... Jerry Feldman
          • ... Jon 'maddog' Hall, Executive Director, Linux International
            • ... Jerry Feldman
              • ... Jon 'maddog' Hall, Executive Director, Linux International
                • ... Jerry Feldman
      • Re: st... Derek Martin

Reply via email to