------- Comment #7 from manu at gcc dot gnu dot org 2008-03-23 22:17 ------- (In reply to comment #6) > Yes. Consider you have code like this: > > void foo(void* bar); // a function somewhere > ... > foo( NULL ); // you call it > ... > > Now consider you want to add an overload foo(int). Now everybody who called > the > original version as foo(0) is suddenly calling a different function, but I > intentionally used NULL to express I'm passing a null pointer, so I expect at > least a warning (and without all the stuff I'd get with -Wconversion). And > this > example is actually based on a real problem that I had to debug in KDE > libraries. >
[EMAIL PROTECTED]:~$ cat test.c #include <stdio.h> void foo( void * a ) { printf ("I'm foo(void*)\n"); } void foo( int a ) { printf ("I'm foo(int)\n"); } int main() { foo (__null); return 0; } [EMAIL PROTECTED]:~$ /home/guerby/release/4.3.0/bin/g++ test.c -fpermissive -o test test.c: In function 'int main()': test.c:15: error: call of overloaded 'foo(NULL)' is ambiguous test.c:3: note: candidates are: void foo(void*) test.c:8: note: void foo(int) Anyway, it is not me the one you have to convince, I cannot approve patches and I said already I don't care which option controls the warning as long as it makes some sense. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35669