From: Gabriel Dos Reis <gdr@cs.tamu.edu>
To: gdb-patches@sourceware.org
Cc: dan@codesourcery.com
Subject: PATCH to gdb/linux-nat.c
Date: Fri, 09 Feb 2007 09:08:00 -0000 [thread overview]
Message-ID: <87odo3ofzd.fsf@soliton.cs.tamu.edu> (raw)
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");
}
next reply other threads:[~2007-02-09 9:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-09 9:08 Gabriel Dos Reis [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87odo3ofzd.fsf@soliton.cs.tamu.edu \
--to=gdr@cs.tamu.edu \
--cc=dan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox