This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Warnings for converting non-pointer types to NULL
- From: Raz <coolmandan at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 12 May 2005 14:53:18 -0500
- Subject: Re: Warnings for converting non-pointer types to NULL
- References: <d5vqlp$k4$1@sea.gmane.org>
- Reply-to: Raz <coolmandan at gmail dot com>
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/