Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!pasteur!agate!bionet!csd4.milw.wisc.edu!indri!larry!jwp From: jwp@larry.UUCP (Jeffrey W Percival) Newsgroups: comp.unix.questions Subject: C and lint: default declarations Message-ID: <501@larry.UUCP> Date: 20 Jan 89 21:24:16 GMT Organization: UW-Madison Space Astronomy Lab Lines: 28 At the risk of starting some kind of style war, let me raise a question. I've always been a bit bothered by this aspect of C: Subroutines and return types must be declared in the calling routine, unless if it returns an integer, and then you can just forget about it. I mean, either declarations are important or they're not, right? Now, before you call me a ninny let me point out that I know why other types must be declared (stacks and all that), and because only one type is excused, the compiler is not really at a loss to know what's going on. Some of the scope rules also seem a bit loose. Probably for historical reasons, I'll wager. The question is, do "good" programmers typically take advantage of these concessions, or do they assiduously declare their integer functions and keep their "scopes" as collapsed as possible? The second part of the question concerns lint. I wish lint had a "strict" mode, where it would not assume such things. For clarity for future browsers, if nothing else, it would be nice to be told that a declaration is missing, even if the compiler can figure it out. Does anyone have a lint-like tool that does not pander to these "forgiving" scope rules and default declarations? -- Jeff Percival (jwp@larry.sal.wisc.edu)