Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* PATCH to gdb/linux-nat.c
@ 2007-02-09  9:08 Gabriel Dos Reis
  2007-02-09 13:49 ` Daniel Jacobowitz
  0 siblings, 1 reply; 8+ messages in thread
From: Gabriel Dos Reis @ 2007-02-09  9:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: dan


Hi,

  This patchlet fixes the build failure

[...]
gcc -c -g -O2    -I. -I/home/gdr/redhat/src/gdb -I/home/gdr/redhat/src/gdb/config -DLOCALEDIR="\"/home/gdr/share/locale\"" -DHAVE_CONFIG_H -I/home/gdr/redhat/src/gdb/../include/opcode -I/home/gdr/redhat/src/gdb/../readline/.. -I../bfd -I/home/gdr/redhat/src/gdb/../bfd -I/home/gdr/redhat/src/gdb/../include   -DMI_OUT=1 -DTUI=1  -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wno-switch -Werror /home/gdr/redhat/src/gdb/linux-nat.c
cc1: warnings being treated as errors
/home/gdr/redhat/src/gdb/linux-nat.c: In function 'linux_nat_find_memory_regions':
/home/gdr/redhat/src/gdb/linux-nat.c:2556: warning: the address of 'filename' will always evaluate as 'true'
make[2]: *** [linux-nat.o] Error 1


for a native configuration on an i686-pc-linux-gnu and a build with
SVN GCC.  The problem is that the existing code was testing whether
the value of 'filename' is null.  That test is statically known to be
false since 'filename' is declared as a local array variable.

OK to apply?

-- Gaby

2007-02-09  Gabriel Dos Reis  <gdr@integrable-solutions.net>

	* linux-nat.c (linux_nat_find_memory_regions): Don't check the
	address of 'filename'; it is always non null.

Index: gdb/linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-nat.c,v
retrieving revision 1.55
diff -p -r1.55 linux-nat.c
*** gdb/linux-nat.c	9 Jan 2007 17:58:51 -0000	1.55
--- gdb/linux-nat.c	9 Feb 2007 08:58:04 -0000
*************** linux_nat_find_memory_regions (int (*fun
*** 2553,2559 ****
  			    size, paddr_nz (addr),
  			    read ? 'r' : ' ',
  			    write ? 'w' : ' ', exec ? 'x' : ' ');
! 	  if (filename && filename[0])
  	    fprintf_filtered (gdb_stdout, " for %s", filename);
  	  fprintf_filtered (gdb_stdout, "\n");
  	}
--- 2553,2559 ----
  			    size, paddr_nz (addr),
  			    read ? 'r' : ' ',
  			    write ? 'w' : ' ', exec ? 'x' : ' ');
! 	  if (filename[0])
  	    fprintf_filtered (gdb_stdout, " for %s", filename);
  	  fprintf_filtered (gdb_stdout, "\n");
  	}


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-02-09 20:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-09  9:08 PATCH to gdb/linux-nat.c Gabriel Dos Reis
2007-02-09 13:49 ` Daniel Jacobowitz
2007-02-09 16:38   ` Gabriel Dos Reis
2007-02-09 19:24     ` Daniel Jacobowitz
2007-02-09 19:39       ` Gabriel Dos Reis
2007-02-09 19:41         ` Daniel Jacobowitz
2007-02-09 19:44           ` Gabriel Dos Reis
2007-02-09 20:00           ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox