lkml.org 
[lkml]   [2007]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Style Question
Date
On Mar 11, 2007, at 19:16:59, Jan Engelhardt wrote:
> On Mar 11 2007 18:01, Kyle Moffett wrote:
>> On the other hand when __cplusplus is defined they define it to
>> the "__null" builtin, which GCC uses to give type conversion
>> errors for "int foo = NULL" but not "char *foo = NULL". A "((void
>> *)0)" definition gives C++ type errors for both due to the broken C
>> ++ void pointer conversion problems.
>
> I think that the primary reason they use __null is so that you can
> actually do
>
> class foo *ptr = NULL;
>
> because
>
> class foo *ptr = (void *)0;
>
> would throw an error or at least a warning (implicit cast from void*
> to class foo*).

Isn't that what I said? :-D

Cheers,
Kyle Moffett

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-03-12 02:31    [W:0.047 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site