[cfe-users] Why is clang defining NULL as __null ??

2019-11-04 Thread pendyala syam via cfe-users
I have a .cpp file which has usage of *NULL* at several places. When I try
to compile this cpp file for Android/x86 platform using clang++ on Windows
machine + standalone tool chain, I am running into "expected expression"
error at the places where *NULL* is used. I find the definition of *NULL* in
stddef.h of clang headers provided by Android NDK as below.

#if defined(__need_NULL)#undef NULL#ifdef __cplusplus#  if
!defined(__MINGW32__) && !defined(_MSC_VER)#define NULL __null#
else#define NULL 0#  endif#else#  define NULL ((void*)0)#endif

As far as I know, __null is specific to GNU compiler. In my case both
_MSC_VER and __MINGW32__ are undefined because I am compiling for Android
platform using clang++ and standalone tool chain. So it is hitting into define
NULL __null. Since clang++ has no clue of what __null is, it is resulting
into "expected expression" error.

My question is, why is clang using macros(like __null) provided by GNU
compiler? Or am I missing something here?

Could somebody please help me understand. Thanks
___
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users


[cfe-users] error: inline function '_BitScanForward' is not defined

2019-11-07 Thread pendyala syam via cfe-users
Hi Team,

While compiling my source cpp file which is including intrin.h, clang is
throwing the following error


error: inline function '_BitScanForward' is not defined [-Werror,-Wundefined
-inline] _BitScanForward (

I checked clang headers for definition but in clang intrin.h header file
its just declared as inline but not defined.

Ref:
https://github.com/llvm-mirror/clang/blob/master/lib/Headers/intrin.h#L146

Ideally inline functions has to be defined in header file itself right? But
why is clang not defining function definitions in the header file? Is there
any specific reason for doing so?

Thanks,
Pendyala
___
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users