[RFC] fix semicolon at the end of RTE_LOG_REGISTER_DEFAULT

Morten Brørup mb at smartsharesystems.com
Mon Apr 22 18:32:41 CEST 2024


> From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> Sent: Monday, 22 April 2024 18.20
> 
> On Mon, 22 Apr 2024 17:24:43 +0200
> Morten Brørup <mb at smartsharesystems.com> wrote:
> 
> >   #define RTE_LOG_REGISTER_IMPL(type, name, level)			    \
> > - int type;								    \
> > + extern int type;								    \
> >   RTE_INIT(__##type)							    \
> >   {									    \
> >   	type = rte_log_register_type_and_pick_level(name,
> RTE_LOG_##level); \
> >   	if (type < 0)
> \
> >   		type = RTE_LOGTYPE_EAL;
> \
> >   }									    \
> > + int type
> 
> 
> Not all logtypes can/should be extern.

Creativity just kicked in:

  #define RTE_LOG_REGISTER_IMPL(type, name, level)			    \
  int type;								    \
  RTE_INIT(__##type)							    \
  {									    \
  	type = rte_log_register_type_and_pick_level(name, RTE_LOG_##level); \
  	if (type < 0)                                                       \
  		type = RTE_LOGTYPE_EAL;                                     \
  }									    \
+ static_assert(1 == 1, "Dummy for semicolon.")



More information about the dev mailing list