[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-inetutils] Re: On the variable attribute "extern".
From: |
Ludovic Courtès |
Subject: |
[bug-inetutils] Re: On the variable attribute "extern". |
Date: |
Wed, 08 Sep 2010 23:42:12 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Hello,
Mats Erik Andersson <address@hidden> writes:
> when looking at the code in "src/tftp.c" I observe six variables
> that are declared as "extern", yet later all six variables are
> instantiated in ordinary declarations.
Variables declared without the ‘extern’ keyword have no linkage, whereas
variables declared ‘extern’ have external linkage (Section 6.2.2 of
ISO/IEC 9899:1999), which has different semantics[*].
Anyway, in the case of ‘tftp.c’ the variables ought to be ‘static’ since
they aren’t used outside of the file AFAICS.
Thanks,
Ludo’.
[*] See for instance the doc of GCC’s ‘-fno-common’ (info "(gcc) Code
Gen Options").