Follow-up from "silence clang warning by using local variable."
The following discussion from !2419 (merged) should be addressed:
There's more usage of
isc_commandline_index(and other global variables from
lib/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.
isc_commandline_argumentshould be moved to
isc_commandline_resetshould be a function, and
isc_commandline_errprintshould be argument to new
isc_commandline_prognameis used only internally.
As a side note - the whole usage of non-const
LIBISC_EXTERNAL_DATAvariables should be eradicated.