[cfe-dev] No implicit conversion from 0 to pointer type

Keith Bauer onesadcookie at gmail.com
Sat Aug 25 18:07:17 PDT 2007


Chris said to email the list about this:

code:

void *foo(void) { return 0; }

Generates:

clang -fsyntax-only test.c
test.c:1:19: warning: incompatible type returning 'int', expected 'void *'
void *foo(void) { return 0; }
                  ^      ~
1 diagnostic generated.

incorrectly -- zero should be implicitly convertable to void*.

-Keith



More information about the cfe-dev mailing list