Warner Losh
2024-04-18 14:47:15 UTC
Hi,
I am trying to add a -W flag to local Makefile so it would only be
effective for the local source files. But it seems not working when I build
the entire kernel.
For example, I added a structure in sys/dev/hyperv/vmbus/vmbus_var.h. The
structure requires adding a -W flag (
-Wno-gnu-variable-sized-type-not-at-end ) to build successfully for all .c
files included this header file.
What does this type look like?I am trying to add a -W flag to local Makefile so it would only be
effective for the local source files. But it seems not working when I build
the entire kernel.
For example, I added a structure in sys/dev/hyperv/vmbus/vmbus_var.h. The
structure requires adding a -W flag (
-Wno-gnu-variable-sized-type-not-at-end ) to build successfully for all .c
files included this header file.
Maybe the right answer is changing it?
CWARNFLAGS += -Wno-gnu-variable-sized-type-not-at-end
Where did you add it? I think it needs to be after the .includesWarner
This seems working fine if I build the module by typing 'make' under
sys/modules/hyperv/vmbus subdir. But it seems having no effect when
building the kernel by using 'make buildkernel' under global directory.
Those .c files still fail to build due to lacking this flag.
If I add this flag in the global sys/conf/kern.mk, it seems to be
working. However, I don't like to add it globally as only a few source
files under hyperv/vmbus need it. What did I do wrong? Do you know what the
proper way to add this flag?
Thanks,
Wei
building the kernel by using 'make buildkernel' under global directory.
Those .c files still fail to build due to lacking this flag.
If I add this flag in the global sys/conf/kern.mk, it seems to be
working. However, I don't like to add it globally as only a few source
files under hyperv/vmbus need it. What did I do wrong? Do you know what the
proper way to add this flag?
Thanks,
Wei