OSDN Git Service

PR c/5623
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Feb 2002 02:28:00 +0000 (02:28 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Feb 2002 02:28:00 +0000 (02:28 +0000)
        * c-typeck.c (incomplete_type_error): Handle flexible array members.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49663 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-typeck.c

index 35a8728..790bc10 100644 (file)
@@ -1,5 +1,10 @@
 2002-02-10  Richard Henderson  <rth@redhat.com>
 
+       PR c/5623
+       * c-typeck.c (incomplete_type_error): Handle flexible array members.
+
+2002-02-10  Richard Henderson  <rth@redhat.com>
+
        PR c++/5624
        * tree.c (append_random_chars): Don't abort if main_input_filename
        does not exist.
index dc844bf..5d5b5f9 100644 (file)
@@ -149,6 +149,11 @@ incomplete_type_error (value, type)
        case ARRAY_TYPE:
          if (TYPE_DOMAIN (type))
            {
+             if (TYPE_MAX_VALUE (TYPE_DOMAIN (type)) == NULL)
+               {
+                 error ("invalid use of flexible array member");
+                 return;
+               }
              type = TREE_TYPE (type);
              goto retry;
            }