On Thursday, March 04, 2021, at 7:19 PM, ellie timoney wrote:
> What happens if you add "-Wall -Wextra -Werror -Wl,--as-needed" to CFLAGS and 
> CXXFLAGS, and then start again from the start?


I did this

[halogen@enigmatic cyrus-imapd-3.2.5]$ export CFLAGS="-g -O2 -Wall -Wextra 
-Werror -Wl,--as-needed"
[halogen@enigmatic cyrus-imapd-3.2.5]$ export CXXFLAGS="-g -O2 -Wall -Wextra 
-Werror -Wl,--as-needed"

then started again from `autoreconf -i`

After the configure command, the "build info" section at the end of the output 
said:

Build info:
   shared:             yes
   static:             no
   cflags:             -g -O2 -Wall -Wextra -Werror -Wl,--as-needed
   cxxflags:           -g -O2 -Wall -Wextra -Werror -Wl,--as-needed
   libs:                -ljansson  -lresolv -lsrs2   -L/usr/lib  -lmysqlclient 
-lpthread -lz -lm -ldl -lssl -lcrypto -lpcre -lpcreposix -lsrs2 -lz -lxml2 
-lical -licalss -licalvcal  -lsqlite3
   ldflags:            -Wl,-rpath,/usr/local/cyruslibs/lib 
-Wl,-rpath,/usr/local/cyruslibs/lib/x86_64-linux-gnu
   unit tests (cunit):

I then ran `make` and this is the error that showed up:


gcc -DHAVE_CONFIG_H -I.  -I/home/halogen/cyrus-imapd-3.2.5/com_err/et -I. 
-I./lib -I. -I./lib -DLIBEXEC_DIR=\"/usr/local/libexec\" 
-DSBIN_DIR=\"/usr/local/sbin\" -DSYSCONF_DIR=\"/etc\" -DHAVE_CONFIG_H      
-I/usr/include/libxml2      -I/usr/local/include   -I/usr/local/include 
-D_FORTIFY_SOURCE=2 -mtune=i686 -O2 -pipe -g -fvisibility=hidden 
-I/usr/include/chardet   -I/usr/include/mysql   -fPIC  -g -O2 -Wall -Wextra 
-Werror -Wl,--as-needed -MT master/master.o -MD -MP -MF $depbase.Tpo -c -o 
master/master.o master/master.c &&\
mv -f $depbase.Tpo $depbase.Po
master/master.c: In function 'do_prom_report':
master/master.c:2172:5: error: ignoring return value of 'ftruncate' declared 
with attribute 'warn_unused_result' [-Werror=unused-result]
2172 |     ftruncate(fd, buf_len(&report));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:5187: master/master.o] Error 1
make[2]: Leaving directory '/home/halogen/cyrus-imapd-3.2.5'
make[1]: *** [Makefile:6897: all-recursive] Error 1
make[1]: Leaving directory '/home/halogen/cyrus-imapd-3.2.5'
make: *** [Makefile:3212: all] Error 2


Here is the full make output:

https://pastebin.com/vSb1PRSP
------------------------------------------
Cyrus: Devel
Permalink: 
https://cyrus.topicbox.com/groups/devel/Tf544987d7d6a54fd-M0a3988b145786b5afb641a23
Delivery options: https://cyrus.topicbox.com/groups/devel/subscription

Reply via email to