[RFC 1/6] eal/linux: remove VLA warnings
Morten Brørup
mb at smartsharesystems.com
Fri Apr 19 14:23:14 CEST 2024
> From: Konstantin Ananyev <konstantin.ananyev at huawei.com>
>
> 1) ./lib/eal/linux/eal_interrupts.c:1073:16: warning: ISO C90 forbids variable
> length array ‘events’ [-Wvla]
>
> eal_intr_handle_interrupts() is called by eal_intr_thread_main()
> so it seems ok to simply alloc space for events from heap and reuse the
> same buffer through the life of the thread.
>
> 2) ./lib/eal/linux/eal_interrupts.c:1319:16: warning: ISO C90 forbids variable
> length array ‘evs’ [-Wvla]
>
> make eal_epoll_wait() to use fixed size array and use it though multiple
> iterations to preocess upt to @maxevents events.
> Note that techically it is not one to one raplacement, as here we might
> reduce number of events returned by first call to epoll_wait(..., timeout);
>
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev at huawei.com>
> ---
Acked-by: Morten Brørup <mb at smartsharesystems.com>
More information about the dev
mailing list