Joined: 20 Dec 2005
|Posted: Fri Nov 02, 2018 7:37 am Post subject: How to debug compile-time warnings for kernel module?
|To connect to the internet, I use an external kernel module. This module is currently displaying some warnings when it compiles, and I'd like to investigate.
The first warning (below) appears to be associated with constprop. If I understand that right, it means the complier is taking functions which produce constants, and optimising them out (e.g. replace 1+1 with 2).
|In function ‘memmove’,
inlined from ‘ConstructEapolKeyData.constprop’ at /home/arch/Netgear/kaduke/port-to-4.15/Netgear-A6210/os/linux/../../common/cmm_wpa.c:3742:3,
inlined from ‘ConstructEapolMsg.constprop’ at /home/arch/Netgear/kaduke/port-to-4.15/Netgear-A6210/os/linux/../../common/cmm_wpa.c:3638:2:
./include/linux/string.h:360:9: warning: argument 2 null where non-null expected [-Wnonnull]
return __builtin_memmove(p, q, size);
I'm not quite sure where to start with this. I've inspected the code, and ConstructEapolMsg is called a number of times - I can only guess which call is the problem.
I can't see any way of debugging during a compile.
If this was a standard program, I might try removing optimisation, and running through gdb. But it's a kernel module, so I'm not sure how practical that is.
Sorry if this is a stupid question - I have had a search, and it's just making me more uncertain. Does anybody have any suggestions or hints?