This is the mail archive of the gdb-patches@sourceware.org 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]

[commit/ob] Avoid GCC warnings/errors in dbxread.c and infcall.c


These two files causes GCC 3.4.4 to print a warning about using a
possibly uninitialized variable, and error out under -Werror.

Committed as obvious.

2009-05-02  Eli Zaretskii  <eliz@gnu.org>

	* dbxread.c (read_dbx_symtab): Avoid compiler warnings for
	sym_name.

	* infcall.c (find_function_addr): Avoid compiler warnings for
	funaddr.

Index: gdb/dbxread.c
===================================================================
RCS file: /cvs/src/src/gdb/dbxread.c,v
retrieving revision 1.100
diff -u -r1.100 dbxread.c
--- gdb/dbxread.c	31 Mar 2009 20:21:07 -0000	1.100
+++ gdb/dbxread.c	2 May 2009 09:40:34 -0000
@@ -1684,6 +1684,7 @@
 	    continue;			/* Not a debugging symbol.   */
 
  	  sym_len = 0;
+	  sym_name = NULL;	/* pacify "gcc -Werror" */
  	  if (psymtab_language == language_cplus)
  	    {
  	      char *new_name, *name = alloca (p - namestring + 1);
Index: gdb/infcall.c
===================================================================
RCS file: /cvs/src/src/gdb/infcall.c,v
retrieving revision 1.111
diff -u -r1.111 infcall.c
--- gdb/infcall.c	22 Mar 2009 17:59:59 -0000	1.111
+++ gdb/infcall.c	2 May 2009 09:40:58 -0000
@@ -243,6 +243,7 @@
 	{
 	  /* Handle function descriptors lacking debug info.  */
 	  int found_descriptor = 0;
+	  funaddr = 0;	/* pacify "gcc -Werror" */
 	  if (VALUE_LVAL (function) == lval_memory)
 	    {
 	      CORE_ADDR nfunaddr;


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