On Wed, 23 Jul 2025 17:20:04 +0100 Bruce Richardson <[email protected]> wrote:
> Create eal_option_list.h, containing all the possible EAL parameters, > and basic info about them, such as type, whether they take a parameter > or not. Each entry is defined using a macro, which will be then > interpreted when the file is included. > > First time this header in included in the eal_common_options.c file, the > macros are defined in such a way as to define field elements for an > "eal_init_args" structure, where each value is either a string type, if > it takes a parameter, or boolean type if it doesn't. For those elements > that take multiple values, i.e. are passed multiple times, we put them > in a TAILQ. > > The second time of inclusion, the macros are defined so as to define the > arguments in an rte_argparse structure for EAL. For the basic string and > boolean types, we just store the values in the appropriate field in the > previous defined "eal_init_args" structure. For the list elements, we > use the argparse callback to process those elements, adding them to the > TAILQ as they are encountered. > > Signed-off-by: Bruce Richardson <[email protected]> This patch introduces another case of shadowed arguments. Suggest renaming the global args variable. I do test builds with -Wshadow [50/3660] Compiling C object lib/librte_eal.a.p/eal_common_eal_common_options.c.o ../lib/eal/common/eal_common_options.c: In function ‘handle_eal_info_request’: ../lib/eal/common/eal_common_options.c:342:16: warning: declaration of ‘args’ shadows a global declaration [-Wshadow] 342 | char **args; | ^~~~ ../lib/eal/common/eal_common_options.c:87:22: note: shadowed declaration is here 87 | struct eal_init_args args = { | ^~~~

