public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/63543] New: incomplete type error should suppress duplicates
@ 2014-10-15  9:47 andi-gcc at firstfloor dot org
  2014-10-15  9:50 ` [Bug c/63543] " mpolacek at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: andi-gcc at firstfloor dot org @ 2014-10-15  9:47 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-17 19:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-15  9:47 [Bug c/63543] New: incomplete type error should suppress duplicates andi-gcc at firstfloor dot org
2014-10-15  9:50 ` [Bug c/63543] " mpolacek at gcc dot gnu.org
2014-10-15 10:00 ` manu at gcc dot gnu.org
2014-10-15 14:47 ` mpolacek at gcc dot gnu.org
2014-10-17 18:54 ` mpolacek at gcc dot gnu.org
2014-10-17 19:12 ` mpolacek at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).