编译出错 --- -Werror=format=

./include/linux/kern_levels.h:5:18: error: format '%llx' expects argument of type 'long long unsigned int', 
but argument 3 has type 'phys_addr_t' {aka 'unsigned int'} [-Werror=format=]

可以通过修改编译选项,加上 -Wno-format 即可,如:

KBUILD_CFLAGS   := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
           -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
           -Werror=implicit-function-declaration -Werror=implicit-int \
           -Werror=return-type -Wno-format \
           -std=gnu89

 

posted @ 2024-07-03 17:15  流水灯  阅读(7)  评论(0编辑  收藏  举报