This is the mail archive of the gcc-bugs@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]

[Bug c/14069] [3.3/3.4/3.5 Regression] This input file lets gcc crash


------- Additional Comments From jakub at gcc dot gnu dot org  2004-03-22 09:15 -------
I know, but that has been added so that GCC doesn't have to track all kinds of
random crap thrown at it, so I don't see why it should be a 3.4 blocker.
Anyway, this doesn't seem to be related to c-typeck.c at all.
c-decl.c (finish_struct) has:
      /* Detect flexible array member in an invalid context.  */
      if (TREE_CODE (TREE_TYPE (x)) == ARRAY_TYPE
          && TYPE_SIZE (TREE_TYPE (x)) == NULL_TREE
          && TYPE_DOMAIN (TREE_TYPE (x)) != NULL_TREE
          && TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (x))) == NULL_TREE)
        {
          if (TREE_CODE (t) == UNION_TYPE)
            error ("%Jflexible array member in union", x);
          else if (TREE_CHAIN (x) != NULL_TREE)
            error ("%Jflexible array member not at end of struct", x);
          else if (! saw_named_field)
            error ("%Jflexible array member in otherwise empty struct", x);
        }
and varasm.c (output_constructor) has:
                  /* Given a non-empty initialization, this field had
                     better be last.  */
                  if (fieldsize != 0 && TREE_CHAIN (field) != NULL_TREE)
                    abort ();
so either finish_struct needs to change the type into an error_mark, or this
varasm.c abort needs to be removed (as it is already errored on in c-typeck.c,
that wouldn't protect from missing this in other frontends though), or
finish_struct could change that field from flexible to error_mark or e.g. one
entry array or something.



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14069


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