[cfe-dev] Getting CXType_Int and data size == 4 for uint64_t

John McCall via cfe-dev cfe-dev at lists.llvm.org
Fri Sep 15 23:49:53 PDT 2017


> On Sep 16, 2017, at 2:24 AM, Hayden Livingston via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> I'm writing a simple parser tool using libclang and I noticed
> something really odd.
> 
> For this simple file as I visit the cursors and call getType on them I
> see that A is detected as CXType_Int and 4 bytes of size, but C is
> also detected as CXType_Int and 4 bytes of size.
> 
> I did not expect this, am I doing something wrong?

Your <stdint.h> is probably not designed for your target.  They often aren't intended to be "portable".

John.

> 
> #include <stdint.h>
> 
> struct TestStruct
> {
>  uint32_t A;
>  const char *B;
>  uint64_t C;
> };
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list