aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-01-15 21:33:18 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-01-15 21:33:18 +0000
commitd904de5b3d3a43ecb03958505c6323cb34379d44 (patch)
treefc40f01b0855a50e9f5ffbf5c092bc76ff0a9393 /gdb
parenta6461c0251a16ac7d7e373636665f3d693c0c81b (diff)
downloadgdb-d904de5b3d3a43ecb03958505c6323cb34379d44.zip
gdb-d904de5b3d3a43ecb03958505c6323cb34379d44.tar.gz
gdb-d904de5b3d3a43ecb03958505c6323cb34379d44.tar.bz2
gdb/
Fix compilation warning on gcc-3.4. * exec.c (print_section_info): Move the `displacement' variable initialization to its declaration.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/exec.c10
2 files changed, 10 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 424daae..0627459 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2010-01-15 Jan Kratochvil <jan.kratochvil@redhat.com>
+ Fix compilation warning on gcc-3.4.
+ * exec.c (print_section_info): Move the `displacement' variable
+ initialization to its declaration.
+
+2010-01-15 Jan Kratochvil <jan.kratochvil@redhat.com>
+
* gdb-gdb.py (StructMainTypePrettyPrinter): Fix TYPE_CODE_RANGE
comparison.
diff --git a/gdb/exec.c b/gdb/exec.c
index 14ee327..c0b4f12 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -675,7 +675,8 @@ print_section_info (struct target_section_table *t, bfd *abfd)
printf_filtered (_("file type %s.\n"), bfd_get_target (abfd));
if (abfd == exec_bfd)
{
- bfd_vma displacement;
+ /* gcc-3.4 does not like the initialization in <p == t->sections_end>. */
+ bfd_vma displacement = 0;
for (p = t->sections; p < t->sections_end; p++)
{
@@ -694,11 +695,8 @@ print_section_info (struct target_section_table *t, bfd *abfd)
}
}
if (p == t->sections_end)
- {
- warning (_("Cannot find section for the entry point of %s.\n"),
- bfd_get_filename (abfd));
- displacement = 0;
- }
+ warning (_("Cannot find section for the entry point of %s.\n"),
+ bfd_get_filename (abfd));
printf_filtered (_("\tEntry point: %s\n"),
paddress (gdbarch, (bfd_get_start_address (abfd)