Linux: -Wsometimes-uninitialized in drivers/net/ethernet/sun/niu.c

Created on 26 Feb 2019  路  3Comments  路  Source: ClangBuiltLinux/linux

Meta: #381

drivers/net/ethernet/sun/niu.c:7466:5: error: variable 'class' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]

in niu_add_ethtool_tcam_entry. Clang doesn't realize that 0 to 3 are the only possible options for that switch. We can just initialize class to zero at the beginning of the function or in the default case (probably the latter with a comment).

-Wsometimes-uninitialized [BUG] linux [FIXED][LINUX] 5.1

All 3 comments

Was this page helpful?
0 / 5 - 0 ratings