From: timeless <timeless@gmail.com>
To: gdb-patches@sourceware.org
Subject: void function cannot return value
Date: Wed, 31 Jan 2007 21:32:00 -0000 [thread overview]
Message-ID: <1a75cc570701311332w440ae8efgfc2e427f72e85115@mail.gmail.com> (raw)
[-- 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
next reply other threads:[~2007-01-31 21:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-31 21:32 timeless [this message]
2007-02-08 16:32 ` Daniel Jacobowitz
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=1a75cc570701311332w440ae8efgfc2e427f72e85115@mail.gmail.com \
--to=timeless@gmail.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