[Bug c/57475] "incompatible pointer type" message is not helpful enough

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri May 31 10:29:00 GMT 2013


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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-05-31
                 CC|                            |manu at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
We could detect the special case where the spelling is the same and report
where each type is declared.

Also, Clang's warning is nicer:

test.c:4:23: warning: declaration of 'struct foo' will not be visible outside
of this function [-Wvisibility]
extern int bar(struct foo *);
                      ^

versus GCC:

test.c:4:23: warning: ‘struct foo’ declared inside parameter list [enabled by
default]
 extern int bar(struct foo *);
                       ^
test.c:4:23: warning: its scope is only this definition or declaration, which
is probably not what you want [enabled by default]


More information about the Gcc-bugs mailing list