https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63543

            Bug ID: 63543
           Summary: incomplete type error should suppress duplicates
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andi-gcc at firstfloor dot org

For a test case like this

struct undefined;

int f(struct undefined *f)
{
    int x = f->a;
    return x + f->a + f->b;
}

tmissing-type.c: In function 'f':
tmissing-type.c:5:11: error: dereferencing pointer to incomplete type
  int x = f->a;
           ^
tmissing-type.c:6:14: error: dereferencing pointer to incomplete type
  return x + f->a + f->b;
              ^
tmissing-type.c:6:21: error: dereferencing pointer to incomplete type
  return x + f->a + f->b;


gcc outputs three different errors for each reference of the undefined type.
It would be better if it remembered that it already gave an error for
referencing that type and suppress the later errors (similar to undefined
symbols). This would avoid cascading errors.

Reply via email to