Hello,

Mats Erik Andersson <mats.anders...@gisladisker.se> 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").

Reply via email to