This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Fix for i386-tdep.c
- To: gdb-patches at sources dot redhat dot com
- Subject: Fix for i386-tdep.c
- From: Mark Kettenis <kettenis at science dot uva dot nl>
- Date: Wed, 4 Apr 2001 17:13:10 +0200 (MET DST)
Just learnt today that GCC doesn't complain about
extern void bar (void);
void
foo (void)
{
return bar ();
}
without -pedentic. That explains why I checked in some
not-quite-ISO-C code in i386-tdep.c. Thanks to Robert Lipe for
pointing this out.
Fixed by the attached patch.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* i386-tdep.c (i386_extract_return_value): Don't return the return
value of a void function.
(i386_store_return_value): Likewise.
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.25
diff -u -r1.25 i386-tdep.c
--- i386-tdep.c 2001/04/01 12:39:52 1.25
+++ i386-tdep.c 2001/04/04 15:00:45
@@ -735,8 +735,10 @@
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
&& TYPE_NFIELDS (type) == 1)
- return i386_extract_return_value (TYPE_FIELD_TYPE (type, 0),
- regbuf, valbuf);
+ {
+ i386_extract_return_value (TYPE_FIELD_TYPE (type, 0), regbuf, valbuf);
+ return;
+ }
if (TYPE_CODE (type) == TYPE_CODE_FLT)
{
@@ -798,7 +800,10 @@
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
&& TYPE_NFIELDS (type) == 1)
- return i386_store_return_value (TYPE_FIELD_TYPE (type, 0), valbuf);
+ {
+ i386_store_return_value (TYPE_FIELD_TYPE (type, 0), valbuf);
+ return;
+ }
if (TYPE_CODE (type) == TYPE_CODE_FLT)
{