When making gcc 4.4.0 20090104 I saved a log of the build. I checked through the build log and found quite a few warnings. If the compiler is working correctly _and_ we code correctly then we will not have warnings (or errors) in our code.
Here is a partial list: /usr/share/src/gcc_build/./gcc/xgcc -B/usr/share/src/gcc_build/./gcc/ -B/usr/local/i386-pc-solaris2.11/bin/ -B/usr/local/i386-pc-solaris2.11/lib/ -isystem /usr/local/i386-pc-solaris2.11/include -isystem /usr/local/i386-pc-solaris2.11/sys-include -g -O2 -m64 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wold-style-definition -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../.././gcc -I../../../../gcc_trunk/libgcc -I../../../../gcc_trunk/libgcc/. -I../../../../gcc_trunk/libgcc/../gcc -I../../../../gcc_trunk/libgcc/../include -I../../../../gcc_trunk/libgcc/../libdecnumber/dpd -I../../../../gcc_trunk/libgcc/../libdecnumber -DHAVE_CC_TLS -o unwind-dw2-fde.o -MT unwind-dw2-fde.o -MD -MP -MF unwind-dw2-fde.dep -fexceptions -c ../../../../gcc_trunk/libgcc/../gcc/unwind-dw2-fde.c -fvisibility=hidden -DHIDE_EXPORTS ../../../../gcc_trunk/libgcc/../gcc/unwind-dw2-fde.c: In function 'fde_unencoded_compare': ../../../../gcc_trunk/libgcc/../gcc/unwind-dw2-fde.c:326: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../../../gcc_trunk/libgcc/../gcc/unwind-dw2-fde.c:327: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../../../gcc_trunk/libgcc/../gcc/unwind-dw2-fde.c: In function 'add_fdes': ../../../../gcc_trunk/libgcc/../gcc/unwind-dw2-fde.c:682: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../../../gcc_trunk/libgcc/../gcc/unwind-dw2-fde.c: In function 'linear_search_fdes': ../../../../gcc_trunk/libgcc/../gcc/unwind-dw2-fde.c:800: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../../../gcc_trunk/libgcc/../gcc/unwind-dw2-fde.c: In function 'binary_search_unencoded_fdes': ../../../../gcc_trunk/libgcc/../gcc/unwind-dw2-fde.c:848: warning: dereferencing type-punned pointer will break strict-aliasing rules if [ x"-fpic" != x ]; then \ /usr/share/src/gcc_build/./prev-gcc/xgcc -B/usr/share/src/gcc_build/./prev-gcc/ -B/usr/local/i386-pc-solaris2.11/bin/ -c -DHAVE_CONFIG_H -g -O2 -fexceptions -I. -I../../gcc_trunk/libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic -fpic ../../gcc_trunk/libiberty/cp-demangle.c -o pic/cp-demangle.o; \ else true; fi ../../gcc_trunk/libiberty/cp-demangle.c: In function 'cplus_demangle_type': ../../gcc_trunk/libiberty/cp-demangle.c:1914: warning: 'ret' may be used uninitialized in this function /usr/share/src/gcc_build/./prev-gcc/xgcc -B/usr/share/src/gcc_build/./prev-gcc/ -B/usr/local/i386-pc-solaris2.11/bin/ -c -DHAVE_CONFIG_H -g -O2 -fexceptions -I. -I../../gcc_trunk/libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic ../../gcc_trunk/libiberty/cp-demangle.c -o cp-demangle.o ../../gcc_trunk/libiberty/cp-demangle.c: In function 'cplus_demangle_type': ../../gcc_trunk/libiberty/cp-demangle.c:1914: warning: 'ret' may be used uninitialized in this function /usr/share/src/gcc_build/./prev-gcc/xgcc -B/usr/share/src/gcc_build/./prev-gcc/ -B/usr/local/i386-pc-solaris2.11/bin/ -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wold-style-definition -Wc++-compat -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -o build/genrecog \ build/genrecog.o build/rtl.o build/read-rtl.o build/ggc-none.o build/vec.o build/min-insn-modes.o build/gensupport.o build/print-rtl.o build/errors.o .././libiberty/libiberty.a build/genrecog ../../gcc_trunk/gcc/config/i386/i386.md \ insn-conditions.md > tmp-recog.c ../../gcc_trunk/gcc/config/i386/i386.md:19694: warning: operand 1 missing mode? ../../gcc_trunk/gcc/config/i386/i386.md:19711: warning: operand 1 missing mode? ../../gcc_trunk/gcc/config/i386/i386.md:19752: warning: operand 1 missing mode? ../../gcc_trunk/gcc/config/i386/i386.md:19769: warning: operand 1 missing mode? ../../gcc_trunk/gcc/config/i386/sse.md:11521: warning: operand 1 missing mode? /bin/sh ../../gcc_trunk/gcc/../move-if-change tmp-recog.c insn-recog.c echo timestamp > s-recog /usr/share/src/gcc_build/./prev-gcc/xgcc -B/usr/share/src/gcc_build/./prev-gcc/ -B/usr/local/i386-pc-solaris2.11/bin/ -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wold-style-definition -Wc++-compat -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -Wno-error -DHAVE_CONFIG_H -I. -I. -I../../gcc_trunk/gcc -I../../gcc_trunk/gcc/. -I../../gcc_trunk/gcc/../include -I../../gcc_trunk/gcc/../libcpp/include -I../../gcc_trunk/gcc/../libdecnumber -I../../gcc_trunk/gcc/../libdecnumber/dpd -I../libdecnumber -DCLOOG_PPL_BACKEND -fexceptions ../../gcc_trunk/gcc/dfp.c -o dfp.o ../../gcc_trunk/gcc/dfp.c: In function 'encode_decimal32': ../../gcc_trunk/gcc/dfp.c:142: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c: In function 'decode_decimal32': ../../gcc_trunk/gcc/dfp.c:158: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c: In function 'encode_decimal64': ../../gcc_trunk/gcc/dfp.c:182: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:188: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c: In function 'decode_decimal64': ../../gcc_trunk/gcc/dfp.c:207: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:212: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c: In function 'encode_decimal128': ../../gcc_trunk/gcc/dfp.c:238: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:248: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c: In function 'decode_decimal128': ../../gcc_trunk/gcc/dfp.c:267: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:274: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:267: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:267: note: initialized from here ../../gcc_trunk/gcc/dfp.c:268: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:268: note: initialized from here ../../gcc_trunk/gcc/dfp.c:269: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:269: note: initialized from here ../../gcc_trunk/gcc/dfp.c:270: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:270: note: initialized from here ../../gcc_trunk/gcc/dfp.c: In function 'encode_decimal128': ../../gcc_trunk/gcc/dfp.c:238: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:238: note: initialized from here ../../gcc_trunk/gcc/dfp.c:239: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:239: note: initialized from here ../../gcc_trunk/gcc/dfp.c:240: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:240: note: initialized from here ../../gcc_trunk/gcc/dfp.c:241: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:241: note: initialized from here ../../gcc_trunk/gcc/dfp.c: In function 'decode_decimal32': ../../gcc_trunk/gcc/dfp.c:158: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:158: note: initialized from here ../../gcc_trunk/gcc/dfp.c: In function 'encode_decimal64': ../../gcc_trunk/gcc/dfp.c:182: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:182: note: initialized from here ../../gcc_trunk/gcc/dfp.c:183: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:183: note: initialized from here ../../gcc_trunk/gcc/dfp.c: In function 'decode_decimal64': ../../gcc_trunk/gcc/dfp.c:207: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:207: note: initialized from here ../../gcc_trunk/gcc/dfp.c:208: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules ../../gcc_trunk/gcc/dfp.c:208: note: initialized from here /usr/share/src/gcc_build/./gcc/xgcc -B/usr/share/src/gcc_build/./gcc/ -B/usr/local/i386-pc-solaris2.11/bin/ -B/usr/local/i386-pc-solaris2.11/lib/ -isystem /usr/local/i386-pc-solaris2.11/include -isystem /usr/local/i386-pc-solaris2.11/sys-include -c -g -O2 -W -Wall -gnatpg g-comlin.adb -o g-comlin.o g-comlin.adb: In function 'GNAT.COMMAND_LINE.FIND_LONGEST_MATCHING_SWITCH': g-comlin.adb:96: warning: 'PARAM' may be used uninitialized in this function g-comlin.adb:96: note: 'PARAM' was declared here /usr/share/src/gcc_build/./gcc/xgcc -B/usr/share/src/gcc_build/./gcc/ -B/usr/local/i386-pc-solaris2.11/bin/ -B/usr/local/i386-pc-solaris2.11/lib/ -isystem /usr/local/i386-pc-solaris2.11/include -isystem /usr/local/i386-pc-solaris2.11/sys-include -c -g -O2 -W -Wall -gnatpg g-socket.adb -o g-socket.o g-socket.adb: In function 'GNAT.SOCKETS.SEND_SOCKET': g-socket.adb:1786: warning: 'SIN' is used uninitialized in this function g-socket.adb: In function 'GNAT.SOCKETS.RECEIVE_SOCKET': g-socket.adb:1586: warning: 'SIN' is used uninitialized in this function g-socket.adb: In function 'GNAT.SOCKETS.GET_SOCKET_NAME': g-socket.adb:1001: warning: 'SIN' is used uninitialized in this function g-socket.adb: In function 'GNAT.SOCKETS.GET_PEER_NAME': g-socket.adb:929: warning: 'SIN' is used uninitialized in this function g-socket.adb: In function 'GNAT.SOCKETS.CONNECT_SOCKET': g-socket.adb:623: warning: 'SIN' is used uninitialized in this function g-socket.adb: In function 'GNAT.SOCKETS.BIND_SOCKET': g-socket.adb:396: warning: 'SIN' is used uninitialized in this function g-socket.adb: In function 'GNAT.SOCKETS.ACCEPT_SOCKET': g-socket.adb:277: warning: 'SIN' is used uninitialized in this function ../../xgcc -B../../ -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -gnatpg -gnata -I- -I../rts -I. -I/usr/share/src/gcc_trunk/gcc/ada /usr/share/src/gcc_trunk/gcc/ada/prj-nmsc.adb -o prj-nmsc.o /usr/share/src/gcc_trunk/gcc/ada/prj-nmsc.adb: In function 'Prj.Nmsc.Check_Naming_Schemes': /usr/share/src/gcc_trunk/gcc/ada/prj-nmsc.adb:3272: warning: 'Casing' may be used uninitialized in this function mkdir -p ./i386-pc-solaris2.11/bits/stdtr1c++.h.gch /usr/share/src/gcc_build/./gcc/xgcc -shared-libgcc -B/usr/share/src/gcc_build/./gcc -nostdinc++ -L/usr/share/src/gcc_build/i386-pc-solaris2.11/amd64/libstdc++-v3/src -L/usr/share/src/gcc_build/i386-pc-solaris2.11/amd64/libstdc++-v3/src/.libs -B/usr/local/i386-pc-solaris2.11/bin/ -B/usr/local/i386-pc-solaris2.11/lib/ -isystem /usr/local/i386-pc-solaris2.11/include -isystem /usr/local/i386-pc-solaris2.11/sys-include -m64 -Winvalid-pch -x c++-header -g -O2 -I/usr/share/src/gcc_build/i386-pc-solaris2.11/amd64/libstdc++-v3/include/i386-pc-solaris2.11 -I/usr/share/src/gcc_build/i386-pc-solaris2.11/amd64/libstdc++-v3/include -I/usr/share/src/gcc_trunk/libstdc++-v3/libsupc++ -O2 -g /usr/share/src/gcc_trunk/libstdc++-v3/include/precompiled/stdtr1c++.h -o i386-pc-solaris2.11/bits/stdtr1c++.h.gch/O2g.gch /usr/share/src/gcc_trunk/libstdc++-v3/include/precompiled/stdtr1c++.h:34:25: warning: /usr/share/src/gcc_build/i386-pc-solaris2.11/amd64/libstdc++-v3/include/i386-pc-solaris2.11/bits/stdc++.h.gch/O0g.gch: created and used with differing settings of '-momit-leaf-frame-pointer' libtool: compile: /usr/share/src/gcc_build/./gcc/xgcc -shared-libgcc -B/usr/share/src/gcc_build/./gcc -nostdinc++ -L/usr/share/src/gcc_build/i386-pc-solaris2.11/libstdc++-v3/src -L/usr/share/src/gcc_build/i386-pc-solaris2.11/libstdc++-v3/src/.libs -B/usr/local/i386-pc-solaris2.11/bin/ -B/usr/local/i386-pc-solaris2.11/lib/ -isystem /usr/local/i386-pc-solaris2.11/include -isystem /usr/local/i386-pc-solaris2.11/sys-include -I/usr/share/src/gcc_build/i386-pc-solaris2.11/libstdc++-v3/include/i386-pc-solaris2.11 -I/usr/share/src/gcc_build/i386-pc-solaris2.11/libstdc++-v3/include -I/usr/share/src/gcc_trunk/libstdc++-v3/libsupc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -g -O2 -c ../../../../gcc_trunk/libstdc++-v3/src/locale_init.cc -fPIC -DPIC -o .libs/locale_init.o ../../../../gcc_trunk/libstdc++-v3/src/locale_init.cc: In static member function 'static const std::locale& std::locale::classic()': ../../../../gcc_trunk/libstdc++-v3/src/locale_init.cc:247: warning: dereferencing type-punned pointer will break strict-aliasing rules libtool: compile: /usr/share/src/gcc_build/./gcc/xgcc -B/usr/share/src/gcc_build/./gcc/ -B/usr/local/i386-pc-solaris2.11/bin/ -B/usr/local/i386-pc-solaris2.11/lib/ -isystem /usr/local/i386-pc-solaris2.11/include -isystem /usr/local/i386-pc-solaris2.11/sys-include -DHAVE_CONFIG_H -I. -I../../../gcc_trunk/libgfortran -I. -iquote../../../gcc_trunk/libgfortran/io -I../../../gcc_trunk/libgfortran/../gcc -I../../../gcc_trunk/libgfortran/../gcc/config -I../.././gcc -D_GNU_SOURCE -std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -fcx-fortran-rules -g -O2 -MT write.lo -MD -MP -MF .deps/write.Tpo -c ../../../gcc_trunk/libgfortran/io/write.c -fPIC -DPIC -o .libs/write.o In file included from ../../../gcc_trunk/libgfortran/io/write.c:42: ../../../gcc_trunk/libgfortran/io/write_float.def: In function 'write_float': ../../../gcc_trunk/libgfortran/io/write_float.def:839: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../../gcc_trunk/libgfortran/io/write_float.def:843: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../../gcc_trunk/libgfortran/io/write_float.def:848: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../../gcc_trunk/libgfortran/io/write_float.def:843: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules ../../../gcc_trunk/libgfortran/io/write_float.def:843: note: initialized from here ../../../gcc_trunk/libgfortran/io/write_float.def:848: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules ../../../gcc_trunk/libgfortran/io/write_float.def:848: note: initialized from here libtool: compile: /usr/share/src/gcc_build/./gcc/xgcc -B/usr/share/src/gcc_build/./gcc/ -B/usr/local/i386-pc-solaris2.11/bin/ -B/usr/local/i386-pc-solaris2.11/lib/ -isystem /usr/local/i386-pc-solaris2.11/include -isystem /usr/local/i386-pc-solaris2.11/sys-include -DHAVE_CONFIG_H -I/usr/share/src/gcc_trunk/boehm-gc/include -fexceptions -Iinclude -I././targ-include -I.//libc/include -g -O2 -fexceptions -Iinclude -I././targ-include -I.//libc/include -c ../../../gcc_trunk/boehm-gc/mark_rts.c -fPIC -DPIC -o .libs/mark_rts.o ../../../gcc_trunk/boehm-gc/mark_rts.c: In function 'GC_approx_sp': ../../../gcc_trunk/boehm-gc/mark_rts.c:379: warning: function returns address of local variable libtool: compile: /usr/share/src/gcc_build/./gcc/xgcc -B/usr/share/src/gcc_build/./gcc/ -B/usr/local/i386-pc-solaris2.11/bin/ -B/usr/local/i386-pc-solaris2.11/lib/ -isystem /usr/local/i386-pc-solaris2.11/include -isystem /usr/local/i386-pc-solaris2.11/sys-include -c -I. -I/usr/share/src/gcc_trunk/libobjc -g -O2 -m64 -W -Wall -Wwrite-strings -Wstrict-prototypes -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions -I/usr/share/src/gcc_trunk/libobjc/objc -I/usr/share/src/gcc_trunk/libobjc/../gcc -I/usr/share/src/gcc_trunk/libobjc/../gcc/config -I../../.././gcc -I/usr/share/src/gcc_trunk/libobjc/../include /usr/share/src/gcc_trunk/libobjc/thr-objc.c -fPIC -DPIC -o .libs/thr-objc.o In file included from ../../.././gcc/gthr-default.h:1, from /usr/share/src/gcc_trunk/libobjc/../gcc/gthr.h:165, from /usr/share/src/gcc_trunk/libobjc/thr-objc.c:42: /usr/share/src/gcc_trunk/libobjc/../gcc/gthr-posix.h: In function '__gthread_objc_thread_detach': /usr/share/src/gcc_trunk/libobjc/../gcc/gthr-posix.h:394: warning: cast to pointer from integer of different size /usr/share/src/gcc_trunk/libobjc/../gcc/gthr-posix.h: In function '__gthread_objc_thread_id': /usr/share/src/gcc_trunk/libobjc/../gcc/gthr-posix.h:491: warning: cast to pointer from integer of different size I left out many duplicate and minor warnings. Thanks, Rob -- Summary: gcc 4.4.0 20090104 - Warnings during bootstrap about poor coding Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rob1weld at aol dot com GCC build triplet: i386-pc-solaris2.11 GCC host triplet: i386-pc-solaris2.11 GCC target triplet: i386-pc-solaris2.11 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38746