Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [Patch] Fix 'incomplete type' warning in dummy_frame.h
@ 2008-09-08  1:00 David Daney
  2008-09-08 11:25 ` Ulrich Weigand
  0 siblings, 1 reply; 4+ messages in thread
From: David Daney @ 2008-09-08  1:00 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 561 bytes --]

Back on 2008-08-26, Ulrich Weigand added a declaration for
dummy_frame_pop to dummy_frame.h.  This causes a fatal warning when I
build with gcc-3.4 targeting mipsel-linux-gnu because struct frame_id is
an incomplete type.

Adding #include "frame.h" fixes the problem for me.

I'm don'e think I have write access to gdb (I do have it in binutils),
so if it is OK, someone will either have to commit it or turn on write
access for me.

2008-09-07  David Daney  <ddaney@avtrex.com>

	* dummy-frame.h (frame.h): Include it.
	(struct frame_id): Remove declaration.


[-- Attachment #2: dummy_frame.h.patch --]
[-- Type: text/plain, Size: 572 bytes --]

Index: dummy-frame.h
===================================================================
RCS file: /cvs/src/src/gdb/dummy-frame.h,v
retrieving revision 1.22
diff -u -p -r1.22 dummy-frame.h
--- dummy-frame.h	26 Aug 2008 17:40:24 -0000	1.22
+++ dummy-frame.h	8 Sep 2008 00:43:01 -0000
@@ -20,10 +20,10 @@
 #if !defined (DUMMY_FRAME_H)
 #define DUMMY_FRAME_H 1
 
+#include "frame.h"
 struct frame_info;
 struct regcache;
 struct frame_unwind;
-struct frame_id;
 
 /* Push the information needed to identify, and unwind from, a dummy
    frame onto the dummy frame stack.  */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Patch] Fix 'incomplete type' warning in dummy_frame.h
  2008-09-08  1:00 [Patch] Fix 'incomplete type' warning in dummy_frame.h David Daney
@ 2008-09-08 11:25 ` Ulrich Weigand
  2008-09-08 15:36   ` David Daney
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Weigand @ 2008-09-08 11:25 UTC (permalink / raw)
  To: David Daney; +Cc: gdb-patches

David Daney wrote:

> Back on 2008-08-26, Ulrich Weigand added a declaration for
> dummy_frame_pop to dummy_frame.h.  This causes a fatal warning when I
> build with gcc-3.4 targeting mipsel-linux-gnu because struct frame_id is
> an incomplete type.
> 
> Adding #include "frame.h" fixes the problem for me.

Huh.  Sorry for the breakage.  Strange that this compiles without even
a warning with GCC 4.1.1 ...

> I'm don'e think I have write access to gdb (I do have it in binutils),
> so if it is OK, someone will either have to commit it or turn on write
> access for me.

If you have access to binutils, you should also have access in GDB, 
as both actually reside in the same src repository.

> 2008-09-07  David Daney  <ddaney@avtrex.com>
> 
> 	* dummy-frame.h (frame.h): Include it.
> 	(struct frame_id): Remove declaration.

This is OK.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Patch] Fix 'incomplete type' warning in dummy_frame.h
  2008-09-08 11:25 ` Ulrich Weigand
@ 2008-09-08 15:36   ` David Daney
  2008-09-08 16:16     ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: David Daney @ 2008-09-08 15:36 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1085 bytes --]

Ulrich Weigand wrote:
> David Daney wrote:
> 
>> Back on 2008-08-26, Ulrich Weigand added a declaration for
>> dummy_frame_pop to dummy_frame.h.  This causes a fatal warning when I
>> build with gcc-3.4 targeting mipsel-linux-gnu because struct frame_id is
>> an incomplete type.
>>
>> Adding #include "frame.h" fixes the problem for me.
> 
> Huh.  Sorry for the breakage.  Strange that this compiles without even
> a warning with GCC 4.1.1 ...

I think it may depend on the ABI.  The calling convention for passing a
struct can vary depending on the size of the struct.

> 
>> I'm don'e think I have write access to gdb (I do have it in binutils),
>> so if it is OK, someone will either have to commit it or turn on write
>> access for me.
> 
> If you have access to binutils, you should also have access in GDB, 
> as both actually reside in the same src repository.
> 

You are correct.  I added a new line after the #include and committed
this version:

2008-09-08  David Daney  <ddaney@avtrex.com>

	* dummy-frame.h (frame.h): Include it.
	(struct frame_id): Remove declaration.


[-- Attachment #2: dummy_frame.h.patch --]
[-- Type: text/plain, Size: 574 bytes --]

Index: dummy-frame.h
===================================================================
RCS file: /cvs/src/src/gdb/dummy-frame.h,v
retrieving revision 1.22
diff -u -p -r1.22 dummy-frame.h
--- dummy-frame.h	26 Aug 2008 17:40:24 -0000	1.22
+++ dummy-frame.h	8 Sep 2008 15:21:35 -0000
@@ -20,10 +20,11 @@
 #if !defined (DUMMY_FRAME_H)
 #define DUMMY_FRAME_H 1
 
+#include "frame.h"
+
 struct frame_info;
 struct regcache;
 struct frame_unwind;
-struct frame_id;
 
 /* Push the information needed to identify, and unwind from, a dummy
    frame onto the dummy frame stack.  */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Patch] Fix 'incomplete type' warning in dummy_frame.h
  2008-09-08 15:36   ` David Daney
@ 2008-09-08 16:16     ` Andreas Schwab
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2008-09-08 16:16 UTC (permalink / raw)
  To: David Daney; +Cc: Ulrich Weigand, gdb-patches

David Daney <ddaney@avtrex.com> writes:

> Ulrich Weigand wrote:
>> David Daney wrote:
>> 
>>> Back on 2008-08-26, Ulrich Weigand added a declaration for
>>> dummy_frame_pop to dummy_frame.h.  This causes a fatal warning when I
>>> build with gcc-3.4 targeting mipsel-linux-gnu because struct frame_id is
>>> an incomplete type.
>>>
>>> Adding #include "frame.h" fixes the problem for me.
>> 
>> Huh.  Sorry for the breakage.  Strange that this compiles without even
>> a warning with GCC 4.1.1 ...
>
> I think it may depend on the ABI.  The calling convention for passing a
> struct can vary depending on the size of the struct.

Only gcc 3.4 and before warn about this.  The standard does not require
complete parameter types in a function prototype that isn't also a
definition.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-09-08 16:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-08  1:00 [Patch] Fix 'incomplete type' warning in dummy_frame.h David Daney
2008-09-08 11:25 ` Ulrich Weigand
2008-09-08 15:36   ` David Daney
2008-09-08 16:16     ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox