Warnings for converting non-pointer types to NULL

Raz coolmandan@gmail.com
Thu May 12 20:45:00 GMT 2005


On 5/12/05, Mikael <mindcooler@gmail.com> wrote:
> I guess presume NULL is a macro evaulting to 0 in windows.h and a typedef
> for (void *)0 in <cstddef>, or?

No. Not in <cstddef>. Since you are using that header file, I assume
you are using C++. In C++, NULL is 0, not (void *)0 as it is in C.

> 
> Since I want to have this warning, the approach I've taken is to always
> include <cstddef> after <windows.h>. Is approach correct and safe or can it
> get me in trouble?

Since marcos cannot be "overloaded" or "overridden", the <cstddef>
marcos would take precedence over conflicting <windows.h> marcos as
long as <cstddef> is included first. However, this should not make a
different since, again assuming you are using C++, both marcos should
be defined to the same value.

> 
> Thanks for any replies
> 
> / M
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 
> 


-- 
-------------------------------------------
 Dan Day
http://razzerblog.blogspot.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list