This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: portability issues with gdb-6.4
- From: Daniel Jacobowitz <drow at false dot org>
- To: Peter O'Gorman <gdb-patches at mlists dot thewrittenword dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Mon, 15 May 2006 11:50:33 -0400
- Subject: Re: portability issues with gdb-6.4
- References: <20060512031606.GB27670@thewrittenword.com>
On Thu, May 11, 2006 at 10:16:06PM -0500, Peter O'Gorman wrote:
> (originally posted to bug-gdb@gnu.org)
>
> Hi,
> We've just built gdb-6.4, and ran into one or two issues.
> 1) In gdb/gdbserver/remote-utils.c a variable is declared not at the
> beginiing of the block. This breaks on many non-recent gcc compilers.
This is already fixed in CVS (2006-03-03). In general, patches against
releases are not very useful.
> 2) Is mips-irix a gdb supported platform? If so the mips subdir does not
> build with the native cc, I'll assume that it builds on this platform
> with gcc, so added a GCC check to configure.
You mean the mips simulator, I gather. Checking for GCC really isn't
right; if anything, it should be fixed. Meanwhile, you can use
--disable-sim.
> 3) Similarly for powerpc-aix, xlc does not build the subdir, so I made
> the dir dependent on gcc. I have not tested if it builds with gcc on
> aix.
Similarly.
> 4) struct symtab_and_line cursal = { }; is not portable. I changed these
> to { 0 }, which compiles with irix cc, but it seems likely that just
> removing the '= { }' would also work.
Thanks a lot. This is a GCC extension. I had to ask around the
office, and we concluded that it is equivalent (in this case) to { 0 }
(but not to no initialization at all, which would leave some fields
uninitialized). I checked in this part.
--
Daniel Jacobowitz
CodeSourcery
2006-05-15 Peter O'Gorman <gdb-patches@mlists.thewrittenword.com>
* source.c (get_current_source_symtab_and_line)
(set_current_source_symtab_and_line): Use { 0 }.
* cli/cli-cmds.c (list_command): Likewise.
Index: source.c
===================================================================
RCS file: /cvs/src/src/gdb/source.c,v
retrieving revision 1.74
diff -u -p -r1.74 source.c
--- source.c 25 Feb 2006 04:36:39 -0000 1.74
+++ source.c 15 May 2006 15:48:33 -0000
@@ -139,7 +139,7 @@ get_lines_to_list (void)
struct symtab_and_line
get_current_source_symtab_and_line (void)
{
- struct symtab_and_line cursal = { };
+ struct symtab_and_line cursal = { 0 };
cursal.symtab = current_source_symtab;
cursal.line = current_source_line;
@@ -178,7 +178,7 @@ set_default_source_symtab_and_line (void
struct symtab_and_line
set_current_source_symtab_and_line (const struct symtab_and_line *sal)
{
- struct symtab_and_line cursal = { };
+ struct symtab_and_line cursal = { 0 };
cursal.symtab = current_source_symtab;
cursal.line = current_source_line;
Index: cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.64
diff -u -p -r1.64 cli-cmds.c
--- cli/cli-cmds.c 23 Jan 2006 16:28:37 -0000 1.64
+++ cli/cli-cmds.c 15 May 2006 15:48:33 -0000
@@ -667,9 +667,9 @@ static void
list_command (char *arg, int from_tty)
{
struct symtabs_and_lines sals, sals_end;
- struct symtab_and_line sal = { };
- struct symtab_and_line sal_end = { };
- struct symtab_and_line cursal = { };
+ struct symtab_and_line sal = { 0 };
+ struct symtab_and_line sal_end = { 0 };
+ struct symtab_and_line cursal = { 0 };
struct symbol *sym;
char *arg1;
int no_end = 1;