[PATCH] examples/cmdline: fix build error with gcc 12

Stephen Hemminger stephen at networkplumber.org
Thu Jan 19 17:44:41 CET 2023


On Thu, 19 Jan 2023 08:59:10 +0000
Bruce Richardson <bruce.richardson at intel.com> wrote:

> > >  struct object {
> > >  	SLIST_ENTRY(object) next;  
> > 
> > I confirm it solves the build warning, but what about to get rid of
> > `OBJ_NAME_LEN_MAX` completely if the intentions is to make size same as
> > cmdline library array:
> >   
> Sure.
> Another potential fix is just to cast-away [(void)] the return value from
> strlcpy and allow truncation.
> 
> Olivier, as maintainer, what is your preferred fix here?
> 
> /Bruce

Another option would be to use flex-array and not have fixed size.


More information about the stable mailing list