Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!ucbcad!ucbvax!cbosgd!clyde!watmath!rbutterworth From: rbutterworth@watmath.waterloo.edu (Ray Butterworth) Newsgroups: comp.lang.c Subject: Re: Another thing broken in ANSI C Message-ID: <16049@watmath.waterloo.edu> Date: 29 Dec 87 14:16:54 GMT References: <3726@hoptoad.uucp> <7109@apple.UUCP> Organization: U of Waterloo, Ontario Lines: 20 In article <7109@apple.UUCP>, kanner@apple.UUCP (Herbert Kanner) writes: > Not quite. Take printf for example. True, it has to be defined with > the (format, ...) notation, but it is a library function and not your > problem. Declarations of the form int printf(); are completely > acceptable; see Section 3.5.3.3, which states: "... an empty list in a > function declaratorthat is not part of a function definition specifies > that no information about the number or types of the parameters is > supplied." Not quite. Declarations of the form "int printf();" are not completely acceptable. What is acceptable is #undef printf int printf(); I already ran into this problem trying to compile something on an ANSI (or as close as one can get to a moving target) C compiler. The program contained the declaration "extern int istty();". This didn't work too well when the file had a #define for isatty(s). It is perfectly acceptable for the header file to have a #define for almost any library function. If you want them to be real functions you have to #undef them before you use them.