Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site cstvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!mcvax!ukc!cstvax!fdc From: fdc@cstvax.UUCP (Frank Cringle) Newsgroups: net.lang.c,net.bugs.4bsd Subject: Undefined static function Message-ID: <297@cstvax.UUCP> Date: Mon, 24-Jun-85 00:27:33 EDT Article-I.D.: cstvax.297 Posted: Mon Jun 24 00:27:33 1985 Date-Received: Thu, 20-Jun-85 10:52:28 EDT Reply-To: fdc@cstvax.UUCP (Frank Cringle) Organization: Comp. Sc., Edinburgh Univ., Scotland Lines: 22 Xref: watmath net.lang.c:5387 net.bugs.4bsd:1562 Here's a question for all the C language lawyers out there. What should a C compiler make of the following: static char *tgoto(); main() { ..... if (tgoto(......)..... ..... } In other words, we declare a function to be static, use it, but do not define it in the source file. This occurs in libcurses/cr_tty.c (4.2BSD). The 4.2 compiler happily accepts this and links the 'static' tgoto to a definition in another source file. In this case it is what the author intended, but it should really have been thrown out by the compiler, methinks. -- Frank Cringle, Dept. of Computer Science, Univ. of Edinburgh UUCP: !ukc!{hwcs,kcl-cs,ucl-cs,edcaad}!cstvax!fdc JANET: fdc@UK.AC.ed.cstvax or fdc@UK.AC.ed.ecsvax