Xref: utzoo comp.lang.c:33440 alt.religion.computers:1998 Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!usc!rutgers!njin!uupsi!sunic!news.funet.fi!hydra!hurtta From: hurtta@cs.Helsinki.FI (Kari Hurtta) Newsgroups: comp.lang.c,alt.religion.computers Subject: Re: ANSI C prototypes Message-ID: Date: 5 Nov 90 14:03:23 GMT References: <1005@christopher-robin.cs.bham.ac.uk> <1906@necisa.ho.necisa.oz> <1990Nov2.030556.27759@ccu.umanitoba.ca> <3933.27353319@cc.helsinki.fi> Sender: hurtta@cs.Helsinki.FI Distribution: comp Organization: Department of Computer Science, University of Helsinki, Finland Lines: 48 In-reply-to: jaakola@cc.helsinki.fi's message of 5 Nov 90 09:38:33 GMT In article <3933.27353319@cc.helsinki.fi> jaakola@cc.helsinki.fi writes: It's okay for me to make an include file, where I declare functions that are visible to other modules. But consider the following example: static void auxiliary_func(a) /* private helper-function */ int a; { ... } void visible_fun(b) int b; { ... auxiliary_func(b+1); /* should be checked */ ... } The point is, why should I have to tell the compiler twice the type of auxiliary_func? The prototype should be necessary only if I make a forward reference to make it easier for the compiler to check types in a single pass. I think the function definition tells unambiguously the types, so I should not have to watch warnings such as "function definition used as a prototype" (Microsoft C 5.1). Ok, I could turn off such warnings in Microsoft C 5.1, but this turns off some useful checks as a side-effect! Please, Microsoft, make a "prototypes-off" switch into Microsoft C for me! Why not: static void auxiliary_func(int a) { ... } void visible_fun(int b) { ... auxiliary_func(b+1); ... } - K E H ( hurtta@cc.Helsinki.FI hurtta@cs.Helsinki.FI HURTTA@FINUH.BITNET )