Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c,comp.lang.c++ Subject: Re: Switching to C# Date: Sun, 16 Jun 2019 02:26:18 -0700 Organization: None to speak of Lines: 25 Message-ID: References: <5d03bb38.3305609877@core> <5d059fdf.3429680737@core> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="df4904b93ef33b63818a6c0a0a5ba2e4"; logging-data="9381"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182uL4SoedyRmgDmzd1hRqV" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:Ho5qmtNHAspyBlOn1ggWG7tAWH4= sha1:QAimaNZI3As4Q0bueh0UsXMtV1k= Xref: csiph.com comp.lang.c:144917 comp.lang.c++:66461 Bonita Montero writes: >> C does allow implicit declarations. You can call a previously >> undeclared function, and C will trust that the types you're passing >> are the types the function's expecting. I think it's a bad idea, and >> it usually yields warnings suggesting that it's a bad idea. I think >> any form of implicit typing is a bad idea. > > Missing forward-declarations aren't a kind of implicit typing. I suppose it depends on what you mean by "implicit typing". In C90, this: int main(void) { some_function(); } was valid, and would implicitly assume that some_function has been defined with no parameters and a return type of int. (And if that assumption were violated, you'd have undefined behavior.) -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */