[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"make distcheck" fails
From: |
Bruno Haible |
Subject: |
"make distcheck" fails |
Date: |
Sat, 11 Jul 2020 13:15:25 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-179-generic; KDE/5.18.0; x86_64; ; ) |
Hi,
The CI job [1] currently fails in the "make distcheck" step. I can reproduce it
on an Ubuntu 16.04.x machine:
$ ./configure --config-cache --enable-gcc-warnings CPPFLAGS="-Wall"
...
$ make V=1
...
gcc -I../lib -I../lib -Wall -fno-common -Wall -Wbad-function-cast
-Wdate-time -Wdisabled-optimization -Wdouble-promotion -Wextra
-Wformat-signedness -Winit-self -Winline -Winvalid-pch -Wlogical-op
-Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes
-Wnested-externs -Wold-style-definition -Wopenmp-simd -Woverlength-strings
-Wpacked -Wpointer-arith -Wshadow -Wstack-protector -Wstrict-overflow
-Wstrict-prototypes -Wsuggest-attribute=const -Wsuggest-attribute=format
-Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wsuggest-final-methods
-Wsuggest-final-types -Wsync-nand -Wtrampolines -Wuninitialized
-Wunknown-pragmas -Wunsafe-loop-optimizations -Wunused-macros -Wvariadic-macros
-Wvector-operation-performance -Wvla -Wwrite-strings -Warray-bounds=2
-Wformat=2 -Werror -g -O2 -MT m4.o -MD -MP -MF $depbase.Tpo -c -o m4.o m4.c &&\
mv -f $depbase.Tpo $depbase.Po
m4.c:166:1: error: function might be candidate for attribute 'pure' if it is
known to return normally [-Werror=suggest-attribute=pure]
fault_handler (int signo)
^
cc1: all warnings being treated as errors
make[2]: *** [Makefile:1875: m4.o] Error 1
The --enable-gcc-warnings option is not enabled by default, but it gets enabled
for "make distcheck" through Makefile.am:
DISTCHECK_CONFIGURE_FLAGS = --enable-changeword --program-prefix=g \
--enable-gcc-warnings --enable-silent-rules --enable-cxx
It is not clear to me whether the function 'fault_handler' should be
marked with attribute 'pure' or not. One one hand, it fits the description
from [2] (namely, that repeated calls to the function perform the same
effects as a single call - because the function does nothing if it does
not call _exit()). On the other hand, [2] also says "a pure function cannot have
any observable side effects" - but 'fault_handler' calls write() and _exit(),
which are side effects.
I would therefore suggest to eliminate this -Werror=suggest-attribute=pure
warning.
The attached patch achieves this.
Bruno
[1]
https://storage.googleapis.com/gitlab-gprd-artifacts/3f/e0/3fe0bab108039f3fd0087d91599c91c1264be96bca03cb2d222220506e93f0ef/2020_07_11/634130389/696039236/job.log?response-content-type=text%2Fplain%3B%20charset%3Dutf-8&response-content-disposition=inline&GoogleAccessId=gitlab-object-storage-prd@gitlab-production.iam.gserviceaccount.com&Signature=yx5rXmQKTx%2Ff%2FmD2MoQ6PeBV7JBXHvu%2FHp817gM5YO3VjMt9l5bA%2B8%2FYXIrz%0AZWtkq4h2v0fQdRuzcjXOaScbHjcoBoI%2BwFC7l248Ds5nxSM0QCheiM8AF1Gt%0AJA1A6UEZDs1nfgjGB463auPhV8DD5fdpoO0owCe%2BVyucUGoINgfyroTSDzm0%0ALHrelt%2FVveBb3%2FITqF5zkVyW1vCtT68ZcSRqG8FQaKe8Cs6Up%2BzAFiSvGKMx%0AQ9YgLEBJ0wrMqBUdYDDB2ErsqxUgVoyDu2bJ1IwqRMA045p9vQZ%2FxqDVEzIE%0AOzCMU3UR27JDI1O7jJWpFJCy6iKtkn43GH%2FQFVN9RA%3D%3D&Expires=1594464650
[2]
https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Common-Function-Attributes.html
0001-Fix-make-distcheck-failure-on-Ubuntu-16.04.patch
Description: Text Data
- "make distcheck" fails,
Bruno Haible <=