[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-talk] Tor 0.2.9.4-alpha is released
Hi Nick,
First time this happens (I have been compiling tor sources with this compiler since around 2009). Not sure about using the -Wlogical-op warning though.
Here is what I get:
==========================
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I./src/ext -Isrc/ext -I./src/ext/trunnel -I./src/trunnel -I./src/common -Isrc/common -I./src/ext/trunnel -I./src/trunnel
-I./src/or -Isrc/or -DSHARE_DATADIR="\"/usr/share\"" -DLOCALSTATEDIR="\"/var\"" -DBINDIR="\"/usr/bin\"" -I./src/common -ftrapv -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m32 -march=i686 -mtune=atom
-fasynchronous-unwind-tables -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector --param ssp-buffer-size=1 -fPIE
-fno-omit-frame-pointer -fasynchronous-unwind-tables -Wall -fno-strict-aliasing -Waddress -Warray-bounds -Wextra -Winit-self -Wlogical-op
-Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wnormalized=id -Woverlength-strings -Woverride-init -Wshadow -Wstrict-overflow=2
-Wsync-nand -Wunused-but-set-parameter -Wunused-but-set-variable -Wvariadic-macros -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes
-Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wnested-externs -Wbad-function-cast -Wswitch-enum
-Waggregate-return -Wpacked -Wunused -Wunused-parameter -Wold-style-definition -Wmissing-declarations -Werror -c -o src/common/util.o src/common/util.c
cc1: warnings being treated as errors
src/common/util.c: In function 'tor_strstrip':
src/common/util.c:643: error: logical '&&' with non-zero constant will always evaluate as true
src/common/util.c: In function 'tor_escape_str_for_pt_args':
src/common/util.c:1397: error: logical '&&' with non-zero constant will always evaluate as true
src/common/util.c: In function 'str_num_before':
src/common/util.c:4730: error: logical '&&' with non-zero constant will always evaluate as true
make[1]: *** [src/common/util.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/builddir/build/BUILD/tor-0.2.9.4-alpha'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.fmqO31 (%build)
==========================
util.c:643:
if (strchr(strip, *readp)) {
util.c:1397:
if (strchr(chars_to_escape, *string))
util.c:4730:
const char *cp = strchr(s, ch);
This link [1] may offer some explanation/workaround (I know it is for a different - older - version of gcc, but the point still stands).
For the time being, I use "tor_cv_cflags_Wlogical_op=no" to disable this warning, but I am not sure whether this is the correct way of dealing with the issue.
[1] http://seclists.org/wireshark/2013/Jan/6
Nick Mathewson wrote:
On Sat, Oct 22, 2016 at 10:27 PM, Dash Four <mr-4@xxxxxxxxxxxxx> wrote:
Nick Mathewson wrote:
Hi, all! There is a new alpha release of the Tor source code, with
fixes for a security bug. You should probably upgrade as packages
become available.
I am having trouble compiling this version. I get the WLogical-op warning
and "logical '&&' with non-zero constant will always evaluate as true" error
message.
The "offending" file is util.c:643, util.c:1397 and util.c4730.
Quick look at ./configure and Google search tells me to use
"tor_cv_cflags_Wlogical_op=no", and if I use that all is well (compiles OK,
haven't run this yet), but I am not sure whether that's right.
My compiler is pretty old (GCC 4.4.5-2), so that might be what is causing
this issue.
If I'm reading that right, that line is just a strchr() call? Do all
the glibc strchr() calls have this problem with your gcc and
-Wlogical-op ?
--
tor-talk mailing list - tor-talk@xxxxxxxxxxxxxxxxxxxx
To unsubscribe or change other settings go to
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-talk