This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/25801] New: bad diagnostic for increment/decrement of pointer to incomplete array


extern int (*a)[];
void g(void) { a++; }

yields the diagnostics

t2.c: In function 'g':
t2.c:2: error: increment of pointer to unknown structure
t2.c:2: error: arithmetic on pointer to an incomplete type

This isn't a pointer to a structure, it's one to an array; and after giving the
first diagnostic, it's useless to go on and give the second as well.


-- 
           Summary: bad diagnostic for increment/decrement of pointer to
                    incomplete array
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jsm28 at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]