a code below:
    struct foo {
        void (*pf)(struct foo (*ptr)[2]); /* error */
    };
causes to report the following error:
    ts.c:4: error: array type has incomplete element type

Isn't the compiler too restrictive ?
Even a typedef is rejected by compiler:
   struct foo;
   typedef struct foo (*foo_tab_ptr)[2];
   typedef void (*pfun)(struct foo[2]);
or a function declaration:
   void f(struct foo[]);


-- 
           Summary: error: array type has incomplete element type
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rdabrowa at poczta dot onet dot pl
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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

Reply via email to