Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!gorodish!guy From: guy%gorodish@Sun.COM (Guy Harris) Newsgroups: comp.lang.c Subject: Re: What real non-UNIX 'C' compilers implement... Message-ID: <29914@sun.uucp> Date: Sat, 3-Oct-87 03:13:00 EDT Article-I.D.: sun.29914 Posted: Sat Oct 3 03:13:00 1987 Date-Received: Tue, 6-Oct-87 06:52:25 EDT References: <721@sugar.UUCP> <814@sugar.UUCP> <29156@sun.uucp> <1059@moscom.UUCP> <3701@venera.isi.edu> Sender: news@sun.uucp Lines: 41 > It is VERY important, for purposes of portability, to make the section 2/ > section 3 distinction. That is, C STANDARD library routines, and system > calls. Why? Because most programmers, particuarly when faced with > something like Turbo C's alphabetical listing of all functions, don't > really know the difference. Then try porting DOS calls to UNIX. It is EXTREMELY irrelevant, for purposes of portability, to make the section 2/section 3 distinction. That is, system calls/C standard AND general UNIX C library calls. Why? Because you're probably going to have no better luck, in general, porting "getpwent", which is in section 3 but is NOT a "C STANDARD library routine", to a non-UNIX system than you are porting "stat" to such a system. Section 3, in UNIX systems, at least, contains plenty of things that are NOT "C STANDARD library routines". The distinction between C standard library routines and routines particular to a specific implementation or operating system is important; however, the distinction between routines listed in section 2 of the UNIX documentation, and routines listed in section 3 of that documentation, is not the same distinction. > Further, standard library routines are supposed to perform in a documented > way, conforming to the standard. System routines need not. Consequently, > from a formal verification standpoint, programs are likely to be safer, > more robust. 1) Is there a formal specification of the C library? If not, formal verification is irrelevant here. 2) I believe people *have* tried making formal specifications of the behavior of UNIX systems (although the systems may have been V6 or V7 systems). 3) "The standard" is still in draft form. 4) There is a standard for UNIX-flavored systems in draft form, so the distinction here between "standard library routines" and "system routines" is not relevant. Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com