Skip to content

Commit 9f9563d

Browse files
juerghpiso77
authored andcommitted
UBUNTU: SAUCE: modpost: Replace 0-length array with flex-array member
Fake flexible arrays (zero-length and one-element arrays) are deprecated, and should be replaced by flexible-array members. This fixes the following compiler warning: CC kernel/module/version.o ../kernel/module/version.c: In function 'check_version': ../kernel/module/version.c:37:21: warning: 'strcmp' reading 1 or more bytes from a region of size 0 [-Wstringop-overread] 37 | if (strcmp(versions->name, symname) != 0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../kernel/module/version.c:8: ../include/linux/module.h:41:14: note: source object 'name' of size 0 41 | char name[0]; | ^~~~ Fixes: 08bc010 ("UBUNTU: SAUCE: modpost: support arbitrary symbol length in modversion") Signed-off-by: Juerg Haefliger <[email protected]> Signed-off-by: Andrea Righi <[email protected]>
1 parent 2f004a4 commit 9f9563d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/module.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct modversion_info {
3838
/* Offset of the next modversion entry in relation to this one. */
3939
u32 next;
4040
u32 crc;
41-
char name[0];
41+
char name[]; /* Flexible array member */
4242
} __packed;
4343

4444
struct module;

0 commit comments

Comments
 (0)