This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Fix gcc-3.4.6: warning: parameter has incomplete type


Hi,

it is unfortunately by a patch from me, it fails to build on RHEL-4.8.x86_64.

There was an issue that gdbtypes.h structure contains DWARF-specific type
cu_offset.  I believe it belongs there.

Apparently old GCC does not like forward declaration for parameter types, so
I moved their definitions.

Is it OK this way or should I make the call_site_parameter_u.param_offset some
generic type instead?


Sorry,
Jan


gdb/
2012-07-03  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix 'warning: parameter has incomplete type' with gcc-3.4.6.
	* dwarf2expr.h: Include gdbtypes.h.
	(enum call_site_parameter_kind, union call_site_parameter_u): Remove
	these forward declarations.
	(cu_offset, sect_offset): Move these ...
	* gdbtypes.h: Remove include dwarf2expr.h.
	(cu_offset, sect_offset): ... here.

diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h
index db49b9c..19efbfd 100644
--- a/gdb/dwarf2expr.h
+++ b/gdb/dwarf2expr.h
@@ -24,22 +24,9 @@
 #define DWARF2EXPR_H
 
 #include "leb128.h"
+#include "gdbtypes.h"
 
 struct dwarf_expr_context;
-enum call_site_parameter_kind;
-union call_site_parameter_u;
-
-/* Offset relative to the start of its containing CU (compilation unit).  */
-typedef struct
-{
-  unsigned int cu_off;
-} cu_offset;
-
-/* Offset relative to the start of its .debug_info or .debug_types section.  */
-typedef struct
-{
-  unsigned int sect_off;
-} sect_offset;
 
 /* Virtual method table for struct dwarf_expr_context below.  */
 
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index cf7d398..3b4edea 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -23,7 +23,6 @@
 #define GDBTYPES_H 1
 
 #include "hashtab.h"
-#include "dwarf2expr.h"
 
 /* Forward declarations for prototypes.  */
 struct field;
@@ -31,6 +30,21 @@ struct block;
 struct value_print_options;
 struct language_defn;
 
+/* These declarations are DWARF-specific as some of the gdbtypes.h data types
+   are already DWARF-specific.  */
+
+/* Offset relative to the start of its containing CU (compilation unit).  */
+typedef struct
+{
+  unsigned int cu_off;
+} cu_offset;
+
+/* Offset relative to the start of its .debug_info or .debug_types section.  */
+typedef struct
+{
+  unsigned int sect_off;
+} sect_offset;
+
 /* Some macros for char-based bitfields.  */
 
 #define B_SET(a,x)	((a)[(x)>>3] |= (1 << ((x)&7)))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]