kr/ct

unable to build with -O3 on Linux+gcc

ysmolski opened this issue · 2 comments

Raised in beanstalkd/beanstalkd#423:

$ make bench
gcc -O3 -Wall -Werror -Wformat=2 -g   -c -o testheap.o testheap.c
gcc -O3 -Wall -Werror -Wformat=2 -g   -c -o testjobs.o testjobs.c
gcc -O3 -Wall -Werror -Wformat=2 -g   -c -o testserv.o testserv.c
gcc -O3 -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
gcc -O3 -Wall -Werror -Wformat=2 -g   -c -o ct/_ctcheck.o ct/_ctcheck.c
gcc -O3 -Wall -Werror -Wformat=2 -g   -c -o ct/ct.o ct/ct.c
ct/ct.c: In function ‘writetokens’:
ct/ct.c:543:18: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
             write(wjobfd, &c, 1); /* ignore error; nothing we can do anyway */
                  ^
ct/ct.c: In function ‘runbenchn’:
ct/ct.c:326:14: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
         write(durfd, &bdur, sizeof bdur);
              ^
ct/ct.c:327:14: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
         write(durfd, &bbytes, sizeof bbytes);
              ^
cc1: all warnings being treated as errors
make: *** [ct/ct.o] Error 1
kr commented

It looks like this may have been fixed in fa5a646. Do these errors still show up on commits after that one?

You are right! These are errors from @sergeyklay trying beanstalkd before I have included an updated ct to it.