Follow-up from "silence clang warning by using local variable."
The following discussion from !2419 (merged) should be addressed:
-
@ondrej started a discussion: (+1 comment) There's more usage of
isc_commandline_index
(and other global variables fromlib/isc/commandline.c
) scattered over BIND 9 source code.I would rather see a refactoring of the API that would not use global variables and would better cover common usage patterns than selectively applying ducktape to silence one specific compiler. The whole isc_commandline API is not thread-safe and it should be.
The
isc_commandline_index
,isc_commandline_option
,isc_commandline_argument
should be moved toisc_commandline_parse()
as arguments,isc_commandline_reset
should be a function, andisc_commandline_errprint
should be argument to newisc_commandline_init()
function.isc_commandline_progname
is used only internally.As a side note - the whole usage of non-const
LIBISC_EXTERNAL_DATA
variables should be eradicated.