Is my C++ compiler broken?
I keep getting this warning (mingw32):
Quote:
warning: passing NULL used for non-pointer converting 2 of `void* memset(void*, int, size_t)'
generated from this line of code:
Code:
memset( array, NULL, sizeof(array) );
Now if NULL expands to 0 or 0L as supposed in C++, and the second arg to memset is an integer (in any sane world), what the heck is my compiler complaining about not being able to be convert NULL to int?!
Furthermore I get the same problem when using "(int)NULL" to explicit cast, yet it is fine with all of "(long)NULL", "(char) NULL" and "(int)(char)NULL" and "(int)(void*)NULL...!!