[dpdk-dev] [PATCH] igb_uio: fix build on Linux 5.3 for implicit fall through

Luca Boccassi bluca at debian.org
Tue Sep 24 20:25:08 CEST 2019


On Mon, 2019-07-29 at 13:32 +0100, Ferruh Yigit wrote:
> build error:
> .../dpdk/build/build/kernel/linux/igb_uio/igb_uio.c:
>    In function ‘igbuio_pci_enable_interrupts’:
>    .../dpdk/build/build/kernel/linux/igb_uio/igb_uio.c:230:6:
>    error: this statement may fall through
>    [-Werror=implicit-fallthrough=]
>   230 |   if (pci_alloc_irq_vectors(udev->pdev, 1, 1, ....
> .../dpdk/build/build/kernel/linux/igb_uio/igb_uio.c:240:2:
>    note: here
>   240 |  case RTE_INTR_MODE_MSI:
>       |  ^~~~
> 
> The build error is caused by Linux kernel commit in 5.3 that enables
> the
> "-Wimplicit-fallthrough=3" gcc flag.
> Commit a035d552a93b ("Makefile: Globally enable fall-through
> warning")
> 
> To fix the error, either a gcc attribute can be provided [1] or a
> code
> comment with some defined syntax need to be provided [2], since there
> is
> already comments, updated them slightly to match the required syntax
> to
> fix the build error.
> 
> [1]
> "__attribute__ ((fallthrough));"
> 
> [2]
> [ \t.!]*([Ee]lse,? |[Ii]ntentional(ly)? )?
> fall(s | |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)?
> 
> Cc: 
> stable at dpdk.org
> 
> 
> Signed-off-by: Ferruh Yigit <
> ferruh.yigit at intel.com
> >
> ---
>  kernel/linux/igb_uio/igb_uio.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Ferruh I'm including this in 17.11.7 since it fixes the build on a
number of new distros and it seems simple enough as it just updates the
comment for the compiler's benefit.

Let me know if there are any objections.

-- 
Kind regards,
Luca Boccassi


More information about the dev mailing list