Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail to run “make check” #284

Closed
gzliudan opened this issue Nov 8, 2015 · 7 comments
Closed

fail to run “make check” #284

gzliudan opened this issue Nov 8, 2015 · 7 comments
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@gzliudan
Copy link

gzliudan commented Nov 8, 2015

[root@ol71-devel beanstalkd]# make check
cc -Wall -Werror -Wformat=2 -g -c -o testheap.o testheap.c
cc -Wall -Werror -Wformat=2 -g -c -o testjobs.o testjobs.c
cc -Wall -Werror -Wformat=2 -g -c -o testserv.o testserv.c
cc -Wall -Werror -Wformat=2 -g -c -o testutil.o testutil.c
ct/gen testheap.o testjobs.o testserv.o testutil.o >ct/_ctcheck.c.part
mv ct/_ctcheck.c.part ct/_ctcheck.c
cc -Wall -Werror -Wformat=2 -g -c -o ct/_ctcheck.o ct/_ctcheck.c
cc -Wall -Werror -Wformat=2 -g -c -o ct/ct.o ct/ct.c
ct/ct.c:27:1: error: initializer element is not constant
static const int64 BenchTime = Second;
^
ct/ct.c: In function ‘nstime’:
ct/ct.c:47:5: error: implicit declaration of function ‘clock_gettime’ [-Werror=implicit-function-declaration]
clock_gettime(CLOCK_MONOTONIC, &t);
^
ct/ct.c:47:19: error: ‘CLOCK_MONOTONIC’ undeclared (first use in this function)
clock_gettime(CLOCK_MONOTONIC, &t);
^
ct/ct.c:47:19: note: each undeclared identifier is reported only once for each function it appears in
ct/ct.c: In function ‘runbench’:
ct/ct.c:419:9: error: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘int64’ [-Werror=format=]
printf("%8d\t%10lld ns/op", n, b->dur/n);
^
cc1: all warnings being treated as errors
make: *** [ct/ct.o] Error 1

[root@ol71-devel beanstalkd]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.3/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC)

@gzliudan
Copy link
Author

gzliudan commented Nov 8, 2015

// add a new line
#include <time.h>

// modify static const int64 BenchTime = Second; to
static const int64 BenchTime = 1000 * 1000 * 1000;

// modify printf("%8d\t%10lld ns/op", n, b->dur/n); to
printf("%8d\t%10lld ns/op", n, (long long int)(b->dur/n));

// then
[root@ol71-mini beanstalkd-1.10]# make check
cc -Wall -Werror -Wformat=2 -g -c -o ct/ct.o ct/ct.c
cc ct/_ctcheck.o ct/ct.o linux.o conn.o file.o heap.o job.o ms.o net.o primes.o prot.o sd-daemon.o serv.o time.o tube.o util.o vers.o walg.o testheap.o testjobs.o testserv.o testutil.o -o ct/_ctcheck
ct/_ctcheck
........................................................

PASS

@archon810
Copy link

@kr Same issue on OpenSUSE (42.1).

/tmp/beanstalkd-1.10> make check
cc -Wall -Werror -Wformat=2 -g    -c -o testheap.o testheap.c
cc -Wall -Werror -Wformat=2 -g    -c -o testjobs.o testjobs.c
cc -Wall -Werror -Wformat=2 -g    -c -o testserv.o testserv.c
cc -Wall -Werror -Wformat=2 -g    -c -o testutil.o testutil.c
ct/gen testheap.o testjobs.o testserv.o testutil.o  >ct/_ctcheck.c.part
mv ct/_ctcheck.c.part ct/_ctcheck.c
cc -Wall -Werror -Wformat=2 -g    -c -o ct/_ctcheck.o ct/_ctcheck.c
cc -Wall -Werror -Wformat=2 -g    -c -o ct/ct.o ct/ct.c
ct/ct.c:27:1: error: initializer element is not constant
 static const int64 BenchTime = Second;
 ^
ct/ct.c: In function ‘nstime’:
ct/ct.c:47:5: error: implicit declaration of function ‘clock_gettime’ [-Werror=implicit-function-declaration]
     clock_gettime(CLOCK_MONOTONIC, &t);
     ^
ct/ct.c:47:19: error: ‘CLOCK_MONOTONIC’ undeclared (first use in this function)
     clock_gettime(CLOCK_MONOTONIC, &t);
                   ^
ct/ct.c:47:19: note: each undeclared identifier is reported only once for each function it appears in
ct/ct.c: In function ‘runbench’:
ct/ct.c:419:9: error: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘int64’ [-Werror=format=]
         printf("%8d\t%10lld ns/op", n, b->dur/n);
         ^
cc1: all warnings being treated as errors
<builtin>: recipe for target 'ct/ct.o' failed
make: *** [ct/ct.o] Error 1

@JensRantil
Copy link
Contributor

JensRantil commented Aug 19, 2018

Which C compiler are yall using?

@ysmolski
Copy link
Member

ping @gzliudan @archon810 . is this still valid issue in beanstalkd 1.10?

@ysmolski ysmolski added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 30, 2019
@archon810
Copy link

Just retested and found the same issue is still present, this time on OpenSUSE Leap 15.1, which is the latest released OpenSUSE.

cc --version
cc (SUSE Linux) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

cc -v
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/7/lto-wrapper
OFFLOAD_TARGET_NAMES=hsa:nvptx-none
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,ada,go --enable-offload-targets=hsa,nvptx-none=/usr/nvptx-none, --without-cuda-driver --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/7 --enable-ssp --disable-libssp --disable-libvtv --disable-libcc1 --disable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --with-slibdir=/lib64 --with-system-zlib --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-7 --without-system-libunwind --enable-multilib --with-arch-32=x86-64 --with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux
Thread model: posix
gcc version 7.4.0 (SUSE Linux)

@archon810
Copy link

However, no issues in v1.11:

/tmp/beanstalkd-1.11> make check
cc -Wall -Werror -Wformat=2 -g   -c -o testheap.o testheap.c
cc -Wall -Werror -Wformat=2 -g   -c -o testjobs.o testjobs.c
cc -Wall -Werror -Wformat=2 -g   -c -o testserv.o testserv.c
cc -Wall -Werror -Wformat=2 -g   -c -o testutil.o testutil.c
ct/gen testheap.o testjobs.o testserv.o testutil.o  >ct/_ctcheck.c.part
mv ct/_ctcheck.c.part ct/_ctcheck.c
cc -Wall -Werror -Wformat=2 -g   -c -o ct/_ctcheck.o ct/_ctcheck.c
cc -Wall -Werror -Wformat=2 -g   -c -o ct/ct.o ct/ct.c
cc   ct/_ctcheck.o ct/ct.o linux.o conn.o file.o heap.o job.o ms.o net.o primes.o prot.o sd-daemon.o serv.o time.o tube.o util.o vers.o walg.o testheap.o testjobs.o testserv.o testutil.o  -lrt  -o ct/_ctcheck
ct/_ctcheck
........................................................

PASS

@ysmolski
Copy link
Member

ysmolski commented Jul 3, 2019

@archon810 thank you a lot. That is good news. Looks like 1.11 is better in this regard. We are not going to fix this in 1.10, please use 1.11. If somebody experience problems with compiling 1.11 please open a new ticket.

@ysmolski ysmolski closed this as completed Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants