junneyang / zumastor

Automatically exported from code.google.com/p/zumastor
0 stars 1 forks source link

Compiler warnings in ddsnap as of 1561 #118

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Can these go away?

buffer.c: In function 'new_buffer':
buffer.c:263: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
buffer.c: In function 'preallocate_buffers':
buffer.c:387: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
ddsnapd.c: In function 'setup_sb':
ddsnapd.c:2901: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
ddsnapd.c: In function 'new_sb':
ddsnapd.c:4335: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
ddsnapd.c: In function 'incoming':
ddsnapd.c:3901: warning: passing argument 2 of 'usecount' discards 
qualifiers from pointer target type
daemonize.c: In function 'open_logfile':
daemonize.c:82: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
daemonize.c:84: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
ddsnap.c: In function 'apply_delta_extents':
ddsnap.c:1257: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
ddsnap.c: At top level:
ddsnap.c:176: warning: 'error_exit' defined but not used
ddsnap.c: In function 'apply_delta_extents':
ddsnap.c:1185: warning: 'err' is used uninitialized in this function
ddsnap.c:1180: warning: 'snapdev1' may be used uninitialized in this 
function
ddsnap.c:1201: warning: 'up_extent2' may be used uninitialized in this 
function
ddsnap.c:1201: warning: 'up_extent1' may be used uninitialized in this 
function
ddsnap.c:1200: warning: 'comp_delta' may be used uninitialized in this 
function
ddsnap.c:1200: warning: 'delta_data' may be used uninitialized in this 
function
ddsnap.c:1200: warning: 'extent_data' may be used uninitialized in this 
function
ddsnap.c:1200: warning: 'updated' may be used uninitialized in this 
function
ddsnap.c: In function 'generate_delta_extents':
ddsnap.c:799: warning: 'extent_addr' may be used uninitialized in this 
function
ddsnap.c: In function 'main':
ddsnap.c:1621: warning: 'csock' may be used uninitialized in this 
function
ddsnap.c:1621: note: 'csock' was declared here

Original issue reported on code.google.com by williama...@gmail.com on 18 Apr 2008 at 11:20

GoogleCodeExporter commented 9 years ago
[lackey:~/zumastor] 
willn % gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured 
with: ../src/configure -v 
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr 
--enable-shared --with-system-zlib --libexecdir=/usr/lib 
--without-included-gettext --enable-threads=posix --enable-nls 
--with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr 
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu 
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)

*about warning: dereferencing type-punned pointer will break strict-aliasing 
rules*
http://mail.opensolaris.org/pipermail/tools-gcc/2005-August/000047.html

Original comment by williama...@gmail.com on 18 Apr 2008 at 11:31

GoogleCodeExporter commented 9 years ago
The automated builders are running in gutsy openvz containers with:
root@uncontested-vz102:/# gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured 
with: ../src/configure -v 
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr 
--enable-shared --with-system-zlib --libexecdir=/usr/lib 
--without-included-gettext --enable-threads=posix --enable-nls 
--with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1 
--enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug 
--enable-mpfr --enable-checking=release 
x86_64-linux-gnu
Thread model: posix
gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

Original comment by williama...@gmail.com on 18 Apr 2008 at 11:35

GoogleCodeExporter commented 9 years ago

Original comment by daniel.r...@gmail.com on 30 Apr 2008 at 6:36

GoogleCodeExporter commented 9 years ago
This clears up all but a few spurious warnings, I think.

Jiaying, can you review?

Original comment by daniel.r...@gmail.com on 30 Apr 2008 at 8:51

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the LGTM.  I'll commit it once I have the smoke tests happy.

Original comment by daniel.r...@gmail.com on 30 Apr 2008 at 11:48

GoogleCodeExporter commented 9 years ago
Smoke tests happy, fix committed in r1638 and r1639

Original comment by daniel.r...@gmail.com on 2 May 2008 at 1:24