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

             Bug #: 52825
           Summary: incorrect message for "incompatible pointer type" with
                    typedeffed structs
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: gu...@mailinator.com


presented with the following code:


typedef struct
{
    /*doesn't matter what's here*/
}
foo;

void f(foo*);

void main(int argc, char** argv)
{
    struct foo* bar;
    f(bar);
}


compiled with "gcc -c test.c", the following warning is produced:

test.c: In function 'main':
test.c:12:2: warning: passing argument 1 of 'f' from incompatible pointer type
[enabled by default]
test.c:7:6: note: expected 'struct foo *' but argument is of type 'struct foo
*'

The two types printed are the same, but the actual types are more like "foo*"
vs "struct foo*" (which are what clang mentions in its warning here).

Reply via email to