This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Restore obj-c++ boostrap [Was Re: patch: enable -fshow-column by default]
- From: Simon Martin <simartin at users dot sourceforge dot net>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: Ian Lance Taylor <iant at google dot com>, gcc-patches at gcc dot gnu dot org, tromey at redhat dot com
- Date: Sat, 13 Jun 2009 10:36:10 +0200
- Subject: Restore obj-c++ boostrap [Was Re: patch: enable -fshow-column by default]
- References: <20090520142305.GA14937@redhat.com> <m3pre33kbf.fsf@google.com> <20090521001057.GA26149@redhat.com> <20090526184416.GA872@redhat.com> <m3my8sbo2q.fsf@google.com> <20090601161048.GA14573@redhat.com>
Hello,
Fixed and committed
This broke bootstrap when configuring with obj-c++ enabled.
There are two problems:
(i) The start/finish_struct macros in objcp-decl.h have not been
updated properly
(ii) The signature of finish_decl for C++ not matching the one
for C
anymore (is it intended?)
This gives:
../../src/gcc/objc/objc-act.c: In function 'objc_start_struct':
../../src/gcc/objc/objc-act.c:433:3: error: too few arguments to
function 'objcp_start_struct'
cc1: warnings being treated as errors
../../src/gcc/objc/objc-act.c:429:25: error: unused parameter 'name'
../../src/gcc/objc/objc-act.c: In function 'objc_finish_struct':
../../src/gcc/objc/objc-act.c:445:37: error: macro "finish_struct"
passed 6 arguments, but takes just 5
../../src/gcc/objc/objc-act.c:444:3: error: return from incompatible
pointer type
../../src/gcc/objc/objc-act.c:440:26: error: unused parameter 'type'
../../src/gcc/objc/objc-act.c:440:37: error: unused parameter 'fieldlist'
../../src/gcc/objc/objc-act.c: In function 'finish_var_decl':
../../src/gcc/objc/objc-act.c:1516:3: error: passing argument 2 of
'finish_decl' makes pointer from integer without a cast
../../src/gcc/cp/cp-tree.h:4326:13: note: expected 'tree' but argument
is of type 'location_t'
[...]
The attached patch restores bootstrap. Ok for trunk? (the finish_decl
part will not be needed if the signature mismatch was not intended and
fixed).
Best regards,
Simon
2009-06-13 Simon Martin <simartin@users.sourceforge.net>
* objcp-decl.c (objcp_finish_decl): New wrapper around C++'s finish_decl.
* objcp-decl.h (finish_decl): New macro calling objcp_finish_decl.
(start_struct): Fix argument order.
(finish_struct): Add location argument.
Index: gcc/objcp/objcp-decl.c
===================================================================
--- gcc/objcp/objcp-decl.c (revision 148450)
+++ gcc/objcp/objcp-decl.c (working copy)
@@ -88,6 +88,13 @@
expand_or_defer_fn (finish_function (0));
}
+void
+objcp_finish_decl (tree decl, location_t init_loc ATTRIBUTE_UNUSED,
+ tree init, tree origtype, tree asmspec_tree)
+{
+ finish_decl (decl, init, origtype, asmspec_tree);
+}
+
tree
objcp_xref_tag (enum tree_code code ATTRIBUTE_UNUSED, tree name)
{
Index: gcc/objcp/objcp-decl.h
===================================================================
--- gcc/objcp/objcp-decl.h (revision 148450)
+++ gcc/objcp/objcp-decl.h (working copy)
@@ -26,6 +26,7 @@
extern tree objcp_start_struct (location_t, enum tree_code, tree);
extern tree objcp_finish_struct (location_t, tree, tree, tree);
extern void objcp_finish_function (void);
+extern void objcp_finish_decl (tree, location_t, tree, tree, tree);
extern tree objcp_build_function_call (tree, tree);
extern tree objcp_xref_tag (enum tree_code, tree);
extern int objcp_comptypes (tree, tree);
@@ -37,12 +38,14 @@
invoke the original C++ functions if needed). */
#ifdef OBJCP_REMAP_FUNCTIONS
-#define start_struct(code, name, in_struct, struct_types, loc) \
- objcp_start_struct (code, name)
-#define finish_struct(t, fieldlist, attributes, in_struct, struct_types) \
- objcp_finish_struct (t, fieldlist, attributes)
+#define start_struct(loc, code, name, in_struct, struct_types) \
+ objcp_start_struct (loc, code, name)
+#define finish_struct(loc, t, fieldlist, attributes, in_struct, struct_types) \
+ objcp_finish_struct (loc, t, fieldlist, attributes)
#define finish_function() \
objcp_finish_function ()
+#define finish_decl(decl, loc, init, origtype, asmspec) \
+ objcp_finish_decl(decl, loc, init, origtype, asmspec)
#define xref_tag(code, name) \
objcp_xref_tag (code, name)
#define comptypes(type1, type2) \