This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

Re: Bootstrap broken on debian/amd64?


On Tuesday 01 February 2005 21:29, Richard Henderson wrote:
> On Tue, Feb 01, 2005 at 05:12:26PM +0100, Steven Bosscher wrote:
> > > extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask)
> >
> > Yup.  PR19333, which I commited a fix for last night.  That code
> > really is illegal.
>
> Except that it isn't.  Array decays to pointer in a parameter context.

Grrrrrrr....  You mean 6.7.5.3 sub 7 in C99 right?   Grrrrrrrrr again.
Probably needs something like this, then (not tested):

Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.629
diff -u -3 -p -r1.629 c-decl.c
--- c-decl.c    1 Feb 2005 00:09:02 -0000       1.629
+++ c-decl.c    1 Feb 2005 20:39:41 -0000
@@ -4143,8 +4143,11 @@ grokdeclarator (const struct c_declarato
                itype = build_range_type (sizetype, size_zero_node, NULL_TREE);
              }

-            /* Complain about arrays of incomplete types.  */
-           if (!COMPLETE_TYPE_P (type))
+            /* Complain about arrays of incomplete types.  These are never
+               OK, except in a parameter context, where the array decays to
+               a pointer (see 6.7.5.2 sub 1 and 6.7.5.3 sub 7 in ISO C99).  */
+           if (!COMPLETE_TYPE_P (type)
+               && decl_context != FIELD)
              {
                error ("array type has incomplete element type");
                type = error_mark_node;

But are there more cases other than parameters where we now reject
valid C?  (*Looks at C gurus again...*)

Gr.
Steven


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