This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: Don't use -Wuninitialized if CFLAGS omits -O


This allows gdb_mbuild.sh to work with CFLAGS=-g, which improves
compilation speed and helps with debugging.

2005-02-28  Jim Blandy  <jimb@redhat.com>

	Avoid warnings due to the use of -Wuninitialized without -O.
	* configure.ac (build_warnings): Include -Wuninitialized only if
	CFLAGS is unset at configure time, or CFLAGS is set and includes
	some -O option other than -O0.
	* configure: Regenerated.

Index: gdb/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.12
diff -c -p -r1.12 configure.ac
*** gdb/configure.ac	22 Feb 2005 23:25:11 -0000	1.12
--- gdb/configure.ac	26 Feb 2005 05:22:51 -0000
*************** AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
*** 1088,1095 ****
  # NOTE: If you add to this list, remember to update
  # gdb/doc/gdbint.texinfo.
  build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
! -Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral \
  -Wunused-label -Wunused-function"
  # Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
  # -Wunused-function -Wunused-variable -Wunused-value
  # -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
--- 1088,1108 ----
  # NOTE: If you add to this list, remember to update
  # gdb/doc/gdbint.texinfo.
  build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
! -Wformat -Wparentheses -Wpointer-arith -Wformat-nonliteral \
  -Wunused-label -Wunused-function"
+ 
+ # GCC supports -Wuninitialized only with -O or -On, n != 0.
+ if test x${CFLAGS+set} == xset; then
+   case "${CFLAGS}" in
+     *"-O0"* ) ;;
+     *"-O"* )
+       build_warnings="${build_warnings} -Wuninitialized"
+     ;;
+   esac
+ else
+   build_warnings="${build_warnings} -Wuninitialized"
+ fi
+ 
  # Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
  # -Wunused-function -Wunused-variable -Wunused-value
  # -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
Index: gdb/configure
===================================================================
RCS file: /cvs/src/src/gdb/configure,v
retrieving revision 1.192
diff -c -p -r1.192 configure
*** gdb/configure	22 Feb 2005 23:25:06 -0000	1.192
--- gdb/configure	26 Feb 2005 05:22:53 -0000
*************** fi;
*** 19655,19662 ****
  # NOTE: If you add to this list, remember to update
  # gdb/doc/gdbint.texinfo.
  build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
! -Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral \
  -Wunused-label -Wunused-function"
  # Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
  # -Wunused-function -Wunused-variable -Wunused-value
  # -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
--- 19655,19675 ----
  # NOTE: If you add to this list, remember to update
  # gdb/doc/gdbint.texinfo.
  build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
! -Wformat -Wparentheses -Wpointer-arith -Wformat-nonliteral \
  -Wunused-label -Wunused-function"
+ 
+ # GCC supports -Wuninitialized only with -O or -On, n != 0.
+ if test x${CFLAGS+set} == xset; then
+   case "${CFLAGS}" in
+     *"-O0"* ) ;;
+     *"-O"* )
+       build_warnings="${build_warnings} -Wuninitialized"
+     ;;
+   esac
+ else
+   build_warnings="${build_warnings} -Wuninitialized"
+ fi
+ 
  # Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
  # -Wunused-function -Wunused-variable -Wunused-value
  # -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]