* void function cannot return value
@ 2007-01-31 21:32 timeless
2007-02-08 16:32 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: timeless @ 2007-01-31 21:32 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 589 bytes --]
I tried building gdb6.6 using snv_53 (from opensolaris.org) with sun
studio C 5.8.
SunOS swift 5.11 snv_53 i86pc i386 i86pc
./configure --target=armel-linux
cc: Sun C 5.8 2005/10/13
the build fails because of:
"wrapper.c", line 773: void function cannot return value
".././gdb/cli/cli-cmds.c", line 517: void function cannot return value
"target.c", line 1248: void function cannot return value
"target.c", line 1264: void function cannot return value
the fix (cvs diff attached) is to replace
return (void) foo();
with
foo(); return;
if foo(); is the last statement, omit the return.
[-- Attachment #2: gdb66-sunc58-snv --]
[-- Type: application/octet-stream, Size: 1815 bytes --]
Index: gdb/target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.134
diff -u -p -u -r1.134 target.c
--- gdb/target.c 29 Jan 2007 16:36:01 -0000 1.134
+++ gdb/target.c 31 Jan 2007 21:27:50 -0000
@@ -1252,7 +1252,8 @@ target_flash_erase (ULONGEST address, LO
if (targetdebug)
fprintf_unfiltered (gdb_stdlog, "target_flash_erase (%s, %s)\n",
paddr (address), phex (length, 0));
- return t->to_flash_erase (t, address, length);
+ t->to_flash_erase (t, address, length);
+ return;
}
tcomplain ();
@@ -1268,7 +1269,8 @@ target_flash_done (void)
{
if (targetdebug)
fprintf_unfiltered (gdb_stdlog, "target_flash_done\n");
- return t->to_flash_done (t);
+ t->to_flash_done (t);
+ return;
}
tcomplain ();
Index: gdb/cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.68
diff -u -p -u -r1.68 cli-cmds.c
--- gdb/cli/cli-cmds.c 9 Jan 2007 17:59:00 -0000 1.68
+++ gdb/cli/cli-cmds.c 31 Jan 2007 21:27:50 -0000
@@ -514,7 +514,7 @@ source_command (char *args, int from_tty
}
}
- return source_script (file, from_tty);
+ source_script (file, from_tty);
}
Index: sim/arm/wrapper.c
===================================================================
RCS file: /cvs/src/src/sim/arm/wrapper.c,v
retrieving revision 1.32
diff -u -p -u -r1.32 wrapper.c
--- sim/arm/wrapper.c 9 Jan 2007 17:59:16 -0000 1.32
+++ sim/arm/wrapper.c 31 Jan 2007 21:27:50 -0000
@@ -770,7 +770,7 @@ sim_target_parse_arg_array (argv)
for (i = 0; argv[i]; i++)
;
- return (void) sim_target_parse_command_line (i, argv);
+ sim_target_parse_command_line (i, argv);
}
void
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: void function cannot return value
2007-01-31 21:32 void function cannot return value timeless
@ 2007-02-08 16:32 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2007-02-08 16:32 UTC (permalink / raw)
To: timeless; +Cc: gdb-patches
On Wed, Jan 31, 2007 at 11:32:47PM +0200, timeless wrote:
> the build fails because of:
> "wrapper.c", line 773: void function cannot return value
> ".././gdb/cli/cli-cmds.c", line 517: void function cannot return value
> "target.c", line 1248: void function cannot return value
> "target.c", line 1264: void function cannot return value
>
> the fix (cvs diff attached) is to replace
> return (void) foo();
> with
> foo(); return;
Thanks for the patch! I committed it.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-02-08 16:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-31 21:32 void function cannot return value timeless
2007-02-08 16:32 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox