Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Is 'extern' necessary? Date: Mon, 13 Feb 2017 11:06:24 -0800 Organization: None to speak of Lines: 20 Message-ID: References: <20170213134423.3e115bb6b08b18a261c46bae@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="1053b12f8bdcbe4d28b5788088a4d098"; logging-data="21767"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18+pDT6OKtv1wKuAacfQJo/" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:2jGfYoR3vyZqlGEJpJwsUIz8pq4= sha1:5+feUcU90QBHqajlwsiiUEVlLsU= Xref: csiph.com comp.lang.c:103826 GOTHIER Nathan writes: [...] > Prototypes should always be declared as "extern" since it points to a previous > definition. In what sense is the definition necessarily "previous", and why would that argue in favor of using "extern"? At file scope, this: extern void foo(void); and this: void foo(void); mean exactly the same thing. I don't object to adding the "extern" keyword if you think it makes it clearer, but it's not required. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"