Hi,
My gcc cannot figure out how input_pos can always be initialized:
gcc -D_GNU_SOURCE -DHAVE_CONFIG_H -I. -I/home/mark/src/elfutils/libdwfl
-I.. -I. -I/home/mark/src/elfutils/libdwfl
-I/home/mark/src/elfutils/libdwfl/../libelf
-I/home/mark/src/elfutils/libdwfl/../libebl
-I/home/mark/src/elfutils/libdwfl/../libdw -I..
-I/home/mark/src/elfutils/libdwfl/../lib -Wall -Werror -Wshadow
-Wunused -Wformat=2 -Wextra -std=gnu99 -g -O2 -MT bzip2.o -MD -MP
-MF .deps/bzip2.Tpo -c -o
bzip2.o /home/mark/src/elfutils/libdwfl/bzip2.c
cc1: warnings being treated as errors
In file included from /home/mark/src/elfutils/libdwfl/bzip2.c:4:
/home/mark/src/elfutils/libdwfl/gzip.c: In function ‘__libdw_bunzip2’:
/home/mark/src/elfutils/libdwfl/gzip.c:179: error: ‘input_pos’ may be
used uninitialized in this function
make[2]: *** [bzip2.o] Error 1
I think it is right. input_pos should be explicitly initialized to zero
when mmaped is set. The attached patch does this. OK to commit?
Thanks,
Mark
Show replies by thread
I'm rewriting that code anyway. I'll be sure to check the optimized build
for the next version.
Thanks,
Roland