我正在尝试从源代码安装英特尔的psm
软件包。当我运行时make
,我收到这个奇怪的错误。
$ make
...
make libpsm_infinipath.so
make[1]: Entering directory `/home/kilojoules/psm'
cc -Wall -Werror -fpic -fPIC -D_GNU_SOURCE -funwind-tables -O3 -g3 -DNVALGRIND -I. -I/home/kilojoules/psm/include -I/home/kilojoules/psm/mpspawn -I/home/kilojoules/psm/include/linux-x86_64 -c psm_context.c -o psm_context.o
cc -Wall -Werror -fpic -fPIC -D_GNU_SOURCE -funwind-tables -O3 -g3 -DNVALGRIND -I. -I/home/kilojoules/psm/include -I/home/kilojoules/psm/mpspawn -I/home/kilojoules/psm/include/linux-x86_64 -c psm_ep.c -o psm_ep.o
psm_ep.c: In function '__psm_ep_open':
psm_ep.c:1013:27: error: '%1d' directive output may be truncated writing between 1 and 5 bytes into a region of size 4 [-Werror=format-truncation=]
snprintf(pvalue, 4, "%1d", ports[0]);
^~~
psm_ep.c:1013:26: note: directive argument in the range [0, 65535]
snprintf(pvalue, 4, "%1d", ports[0]);
^~~~~
psm_ep.c:1013:6: note: 'snprintf' output between 2 and 6 bytes into a destination of size 4
snprintf(pvalue, 4, "%1d", ports[0]);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
psm_ep.c:1041:27: error: '%1d' directive output may be truncated writing between 1 and 5 bytes into a region of size 4 [-Werror=format-truncation=]
snprintf(pvalue, 4, "%1d", ports[i]);
^~~
psm_ep.c:1041:26: note: directive argument in the range [0, 65535]
snprintf(pvalue, 4, "%1d", ports[i]);
^~~~~
psm_ep.c:1041:6: note: 'snprintf' output between 2 and 6 bytes into a destination of size 4
snprintf(pvalue, 4, "%1d", ports[i]);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [psm_ep.o] Error 1
make: *** [libs] Error 2
我想抑制错误。这似乎是一个警告而不是一个错误。这是我可以在这里做的事情吗?我该怎么做?
由于将-Werror
标志传递给编译器,因此将其视为错误。该标志告诉编译器将任何警告转换为错误(请参阅cc1: all warnings being treated as errors
)输出行。删除该标志以更改行为(您可能必须编辑 makefile)。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句