Closed GoogleCodeExporter closed 9 years ago
I don't think the patch really addresses the underlying issue.
It just replaces a possible use of an uninitialized variable
with a possible dereference of a null pointer.
It fixes the build error, but doesn't fix the possible run-time error.
Original comment by fergus.h...@gmail.com
on 2 Dec 2008 at 6:49
Original comment by fergus.h...@gmail.com
on 8 Dec 2008 at 11:39
Surely this is simply fixed by making the call to dcc_note_state() conditional
on ret == 0? I would initialize chosen to NULL too, just as good practice.
Original comment by jeremy.w...@gmail.com
on 25 Sep 2010 at 1:37
hi,
I guess I can post similar issue here when I try to make distcc on my iMac:
Darwin bjchenys-iMac 11.0.0 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35
PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64 x86_64
gcc version 4.2.1 Python 2.7.1
bjchenys-iMac:distcc bjcheny$ make
echo "path: $PATH"
path: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
./config.status
config.status: creating Makefile
config.status: creating popt/.stamp-conf
config.status: creating lzo/.stamp-conf
config.status: creating pump
config.status: creating src/config.h
config.status: src/config.h is unchanged
touch src/config.h.stamp
gcc -DHAVE_CONFIG_H -D_GNU_SOURCE -DSYSCONFDIR="\"/usr/local/etc\""
-DPKGDATADIR="\"/usr/local/share/distcc\"" -Isrc -I"./src" -I"./lzo" -I"./popt"
-Werror -g -O2 -MD -W -Wall -Wimplicit -Wshadow -Wpointer-arith -Wcast-align
-Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes
-Wnested-externs -Wmissing-declarations -Wuninitialized -D_THREAD_SAFE -o
src/hosts.o -c src/hosts.c
cc1: warnings being treated as errors
src/hosts.c: In function 'dcc_parse_hosts':
src/hosts.c:562: warning: implicit declaration of function 'strndup'
src/hosts.c:562: warning: incompatible implicit declaration of built-in
function 'strndup'
make: *** [src/hosts.o] Error 1
I wonder any progress/patch or general solution for this kind of issue?
Regards
Original comment by compan...@gmail.com
on 30 May 2012 at 12:34
Forget to add I use to get code:
svn checkout http://distcc.googlecode.com/svn/trunk/ distcc-read-only
Original comment by compan...@gmail.com
on 30 May 2012 at 12:37
The general work-around for compiler warnings is to configure with
"--disable-Werror".
Original comment by fergus.h...@gmail.com
on 30 May 2012 at 3:43
> src/where.c: In function 'dcc_lock_local_cpp':
> src/where.c:193: error: 'chosen' may be used uninitialized in this function
> make: *** [src/where.o] Error 1
The error only occurs when using "-O3".
> Surely this is simply fixed by making the call to
> dcc_note_state() conditional on ret == 0?
Any reason not to apply this fix? It makes sense.
Original comment by mand...@gmail.com
on 8 May 2013 at 2:49
The proposed fix of making the call to dcc_note_state() conditional on ret == 0
sounds good to me.
Original comment by fer...@google.com
on 8 May 2013 at 3:56
This issue was closed by revision r779.
Original comment by mand...@gmail.com
on 10 May 2013 at 2:36
Original issue reported on code.google.com by
mat...@gmail.com
on 29 Oct 2008 at 4:32Attachments: