lkml.org 
[lkml]   [2012]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] do not export kernel's NULL #define to userspace
Date
On Wednesday 21 March 2012, Lubos Lunak wrote:
> GCC's NULL is actually __null, which allows detecting some questionable
> NULL usage and warn about it. Moreover each platform/compiler should have
> its own stddef.h anyway (which is different from linux/stddef.h).
> So there's no good reason to leak kernel's NULL to userspace and
> override what the compiler provides.
>
> Signed-off-by: Luboš Luňák <l.lunak@suse.cz>

Yes, this looks like a bug, but I'm not sure that the solution is
sufficient. Have you checked the other exported header files
for whether they use NULL after including linux/stddef.h?

If so, we might have to replace it with a __KERNEL_NULL constant
or something, like we do for the stuff in linux/types.h, so we
don't accidentally break user applications that rely on the
header files to be self-contained.

I think there is at least a NULL usage in linux/wireless.h and some
netfilter headers.

Arnd
--
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: 2012-03-21 14:35    [W:0.028 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site