This test case demonstrates what i mean:

struct my_struct {
  int x;
  int (*hook_a)( void );
};

int func_a( void )
{
  return 1;
}

void func_b( void )
{
  func_a( );
}

int main( void )
{
  struct my_struct a = { 1, &func_a };
  struct my_struct b = { 2, &func_b };

  return 0;
}

When initializing a struct it would be nice to have an error message detailing
the field which has the incompatible pointer type.


-- 
           Summary: "initialization from incompatible pointer type" struct
                    initilization error handling
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: herron dot philip at googlemail dot com


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

Reply via email to