[dpdk-dev] [PATCH v2 01/11] eal: explain argv behaviour during init

Stephen Hemminger stephen at networkplumber.org
Fri Jun 30 18:23:24 CEST 2023


On Wed, 10 Mar 2021 14:28:15 +0100
Thomas Monjalon <thomas at monjalon.net> wrote:

> After argument parsing done by rte_eal_init(),
> the remaining arguments are to be parsed by the application
> by progressing in the argv array.
> In this context, the first string represented by argv[0] is still
> the same program name as the original argv[0],
> while the next strings are the application arguments.
> This is because rte_eal_init() manipulates the argv array
> after EAL parsing, before returning to the application.
> 
> This note was missing in the doxygen comment of the API.
> 
> Signed-off-by: Thomas Monjalon <thomas at monjalon.net>

I would rather that rte_eal_init() treat the argv arguments
as immutable (ie const). Modifying input arguments is confusing
and can cause some issues.

Other functions (getopt, getopt_long, execv) in glibc use:
	char *const argv[];

It would be good if EAL was the same.


More information about the dev mailing list