Details
-
Bug
-
Resolution: Fixed
-
Minor
-
Lustre 2.16.0
-
None
-
3
-
9223372036854775807
Description
gcc-13 added a new warning:
-Wenum-int-mismatch warns about mismatches between an enumerated type and an integer type
which caused the following Lustre build errors:
/root/lustre-release/lustre/ptlrpc/pack_generic.c:81:5: error: conflicting types for 'lustre_msg_check_version' due to enum/integer mismatch; have 'int(struct lustre_msg_v2 *, enum lustre_msg_version)' [-Werror=enum-int-mismatch] 81 | int lustre_msg_check_version(struct lustre_msg *msg, | ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /root/lustre-release/lustre/ptlrpc/pack_generic.c:48: /root/lustre-release/lustre/include/lustre_net.h:2287:5: note: previous declaration of 'lustre_msg_check_version' with type 'int(struct lustre_msg_v2 *, __u32)' {aka 'int(struct lustre_msg_v2 *, unsigned int)'} 2287 | int lustre_msg_check_version(struct lustre_msg *msg, __u32 version); | ^~~~~~~~~~~~~~~~~~~~~~~~ /root/lustre-release/lustre/ptlrpc/pack_generic.c:858:20: error: conflicting types for 'lustre_msghdr_get_flags' due to enum/integer mismatch; have 'enum lustre_msghdr(struct lustre_msg_v2 *)' [-Werror=enum-int-mismatch] 858 | enum lustre_msghdr lustre_msghdr_get_flags(struct lustre_msg *msg) | ^~~~~~~~~~~~~~~~~~~~~~~ /root/lustre-release/lustre/include/lustre_net.h:2315:7: note: previous declaration of 'lustre_msghdr_get_flags' with type '__u32(struct lustre_msg_v2 *)' {aka 'unsigned int(struct lustre_msg_v2 *)'} 2315 | __u32 lustre_msghdr_get_flags(struct lustre_msg *msg); | ^~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors
liblustreapi_layout.c:2141:5: error: conflicting types for 'llapi_layout_comp_use' due to enum/integer mismatch; have 'int(struct llapi_layout *, enum llapi_layout_comp_use)' [-Werror=enum-int-mismatch] 2141 | int llapi_layout_comp_use(struct llapi_layout *layout, | ^~~~~~~~~~~~~~~~~~~~~ In file included from liblustreapi_layout.c:44: /root/lustre-release/lustre/include/lustre/lustreapi.h:1233:5: note: previous declaration of 'llapi_layout_comp_use' with type 'int(struct llapi_layout *, uint32_t)' {aka 'int(struct llapi_layout *, unsigned int)'} 1233 | int llapi_layout_comp_use(struct llapi_layout *layout, uint32_t pos); | ^~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors