Linux 编译coreutils时出错-错误:函数可能是属性';常数';[-Werror=suggest attribute=const]

Linux 编译coreutils时出错-错误:函数可能是属性';常数';[-Werror=suggest attribute=const],linux,gcc,gnu-make,gnu-coreutils,Linux,Gcc,Gnu Make,Gnu Coreutils,我尝试在Ubuntu 18.4上编译coreutils。以下是我迄今为止所做的: sudo apt install bison gperf make textinfo git clone git://git.sv.gnu.org/coreutils cd coreutils ./bootstrap ./configure make 这以一个错误结尾,即: lib/acl-internal.c: In function 'free_permission_context': lib/ac

我尝试在Ubuntu 18.4上编译coreutils。以下是我迄今为止所做的:

sudo apt install bison gperf make textinfo

git clone git://git.sv.gnu.org/coreutils

cd coreutils

./bootstrap

./configure

make
这以一个错误结尾,即:

lib/acl-internal.c: In function 'free_permission_context':
lib/acl-internal.c:479:1: error: function might be candidate for attribute 'const' [-Werror=suggest-attribute=const]
 free_permission_context (struct permission_context *ctx)
 ^~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Makefile:9808: recipe for target 'lib/acl-internal.o' failed
make[2]: *** [lib/acl-internal.o] Error 1
make[2]: Leaving directory '/path/to/coreutils'
Makefile:12445: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/path/to/coreutils'
Makefile:6556: recipe for target 'all' failed
make: *** [all] Error 2
添加编译器标志

make CFLAGS='-Wno-error=suggest-attribute=const'
列出了一些其他选项:

我建议使用:

 -Wno-error=suggest-attribute=pure
 -Wno-error=suggest-attribute=const
 -Wno-error=suggest-attribute=noreturn
 -Wno-error=suggest-attribute=format
 -Wno-error=suggest-attribute=cold
 -Wno-error=suggest-attribute=malloc