On Fri, Nov 03, 2023 at 10:17:49AM +0000, Bruce Richardson wrote: > On Thu, Nov 02, 2023 at 11:55:41AM -0700, Stephen Hemminger wrote: > > On Thu, 2 Nov 2023 18:11:48 +0000 Bruce Richardson > > <bruce.richard...@intel.com> wrote: > > > > > From: Bruce Richardson <bruce.richard...@intel.com> To: dev@dpdk.org > > > Cc: step...@networkplumber.org, Bruce Richardson > > > <bruce.richard...@intel.com> Subject: [PATCH] eal: add const to init > > > function parameter Date: Thu, 2 Nov 2023 18:11:48 +0000 X-Mailer: > > > git-send-email 2.39.2 > > > > > > Change the parameter type of argv parameter to rte_eal_init from > > > "char **" to "char * const *", since we don't modify the argv > > > pointers passed in. > > > > > > Signed-off-by: Bruce Richardson <bruce.richard...@intel.com> > > > > Looks good but probably needs to cascade down a few more levels > > Yep. I only did a quick compile test, which passed, but I see the CI has > thrown up a bunch more issues. I'll do a v2 later. > Actually, this is not going to work as a patch. Marking as rejected in patchwork. This is because after parsing the EAL args, we actually assign the last arg handled, often "--", to be a copy of argv[0]. In short, we guarantee that when we do:
int ret = rte_eal_init(argc, argv); /* error handling */ argv += ret; argc -= ret; that argv[0] is the original program name set as argv[0], and so application arg processing can be done in the usual way. Because of this, we do modify the params, and so can't set it as an array of const pointers. /Bruce