Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: weird c code/ c test Message-ID: <6287@brl-smoke.ARPA> Date: Sat, 15-Aug-87 12:33:15 EDT Article-I.D.: brl-smok.6287 Posted: Sat Aug 15 12:33:15 1987 Date-Received: Tue, 18-Aug-87 03:19:24 EDT References: <1089@gilsys.UUCP> <175400004@uxc.cso.uiuc.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 20 In article <175400004@uxc.cso.uiuc.edu> hamilton@uxc.cso.uiuc.edu writes: >next, you'll want me to #include when i use ctime(). Yes, as a matter of fact. Both X3.159-198x and IEEE 1003.1 permit the application code to omit the header that is supposed to declare the type of a library function if and only if the application code itself correctly declares the type; this is not always possible without some definitions from the header. In the case of printf(), IF you can correctly declare its type without , then having done so you could omit . However, if there happened to be a spiffy macro implementation of the function defined in , you would be missing out on it thereby, so it is not generally advisable to circumvent the declarations from the standard headers. The other problem is, printf() is a variable- arguments function, and as such will require a correct function prototype to be in scope in an ANSI C environment. Although one could declare the type "by hand" using #if __STDC__ to accommodate the differences between old C and ANSI C, it is much simpler and more convenient to let take care of getting the declaration right.