[Libclc-dev] [PATCH] Don't include <stddef.h>

Jeroen Ketema j.ketema at imperial.ac.uk
Fri Oct 17 16:13:29 PDT 2014


> On 18 Oct 2014, at 00:04, Matt Arsenault <arsenm2 at gmail.com> wrote:
> 
> 
> On Oct 17, 2014, at 3:56 PM, Jeroen Ketema <j.ketema at imperial.ac.uk> wrote:
> 
>> 
>>> On 17 Oct 2014, at 23:41, Jean-Sébastien Pédron <dumbbell at FreeBSD.org> wrote:
>>> 
>>> On 18.10.2014 00:34, Jeroen Ketema wrote:
>>>> This means we loose support for ptrdiff_t (typedef __PTRDIFF_TYPE__ 
>>>> ptrdiff_t;), which is an OpenCL required type.
>>> 
>>> I'll add that type.
>>> 
>>>> Moreover, we loose NULL in this way. Although NULL is not strictly 
>>>> required, it’s useful to have around.
>>> 
>>> Are you fine with the following #define?
>>> 
>>> #define NULL ((void*)0)
>> 
>> That seems to be the one that is currently picked up from stddef. So, yes.
>> 
>> Jeroen
> 
> 
> I’m not sure if that will work correctly with address spaces. There is some null predefined (__null maybe)? which might be required

I think clang has be taught not to complain about the address space in case of ((void*)0)? I could not trigger any warning, but I might simply not know how to set the warning level sufficiently high enough.

I don’t think __null exists.

Jeroen





More information about the Libclc-dev mailing list