Linus Torvalds writes: (Summary) wrote:
Yeah, that was discussed separately, I just didn't realize we had any such users.
such users.
As David said, just adding a (long) cast to it should be fine, ie As David said, just adding a (long) cast to it should be fine, ie #define __is_constant(a) \
(sizeof(int) == sizeof(*(1 ? ((void*)((long)(a) * 0l)) : (int*)1))) and is probably a good idea even outside of pointers (because "long long" constants could cause warnings too due to the cast to (void *)).
[...]
Seems like it doesn't like void * arguments:Yeah, that was discussed separately, I just didn't realize we had any such users.
such users.
As David said, just adding a (long) cast to it should be fine, ie As David said, just adding a (long) cast to it should be fine, ie #define __is_constant(a) \
(sizeof(int) == sizeof(*(1 ? ((void*)((long)(a) * 0l)) : (int*)1))) and is probably a good idea even outside of pointers (because "long long" constants could cause warnings too due to the cast to (void *)).