仮想マシンで実験するために、Cで基本的なカーネルモジュールを作成しています。現在のところ、私のコードはすべて正常に動作しますが、コンパイル時には、私が誤って見落としてしまうかもしれないエラーを表示するのが難しいカーネルヘッダファイルから警告を受け取ります。カーネルモジュールのコンパイル時にMakefileが '-isystem'フラグを無視する
外部ライブラリからの警告を無効にする方法については、hereが見つかりました.GCC -isystem {dir}
フラグを使用する必要がありますが、これは機能していないようです。誰かが間違っていることを指摘できますか?
make -C /lib/modules/{my kernel}/build M=/root/Documents/Projects/TestKernelMod modules
make[1]: Entering directory '/usr/src/kernels/{my kernel}'
/usr/src/kernels/{my kernel}/arch/x86/Makefile:81: stack protector enabled but no compiler support
CC [M] /root/Documents/Projects/TestKernelMod/src/main.o
In file included from /usr/src/kernels/{my kernel}/arch/x86/include/asm/smp.h:13:0,
from /usr/src/kernels/{my kernel}/arch/x86/include/asm/mmzone_64.h:12,
from /usr/src/kernels/{my kernel}/arch/x86/include/asm/mmzone.h:4,
from include/linux/mmzone.h:850,
from include/linux/gfp.h:4,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from /root/Documents/Projects/TestKernelMod/src/main.c:2:
/usr/src/kernels/{my kernel}/arch/x86/include/asm/apic.h: In function ‘native_apic_msr_read’:
/usr/src/kernels/{my kernel}/arch/x86/include/asm/apic.h:150:11: warning: variable ‘high’ set but not used [-Wunused-but-set-variable]
u32 low, high;
^~~~
/usr/src/kernels/{my kernel}/arch/x86/include/asm/apic.h: In function ‘x2apic_enabled’:
/usr/src/kernels/{my kernel}/arch/x86/include/asm/apic.h:190:11: warning: variable ‘msr2’ set but not used [-Wunused-but-set-variable]
int msr, msr2;
^~~~
明示的に '-isystem/usr/src/kernel/{my kernel}/arch/x86/include/asm/apic.h'を実行すると、以前の警告が取り除かれますか? – fedepad