22/08/2022 17:09, Ferruh Yigit:
> On 7/9/2022 12:49 AM, lon...@linuxonhyperv.com wrote:
> > +               for (uint16_t seg_idx = 0; seg_idx < m_pkt->nb_segs; 
> > seg_idx++) {
> 
> This is C99 feature and we tend to not use it BUT,
> 
> Thomas, David,
> 
> In the past there were c89/c90/ansi code in DPDK, but as far as I can 
> see no more left.
> 
> Is there anything that prevents us using C99 features, like variable in 
> the for loop, I think it is usefull that it reduces the scope and makes 
> code more readable, etc...

I agree that variable declaration in the "for" loop is nice.
I would be very cautious to test that all compilers used around
don't emit a warning. If it passes the tests, I think we can accept
and update the coding style documentation to make it officially allowed.


Reply via email to