Fix for i386-tdep.c
Mark Kettenis
kettenis@science.uva.nl
Wed Apr 4 08:15:00 GMT 2001
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)
{
More information about the Gdb-patches
mailing list