[cfe-dev] libclang on 64-bit Ubuntu treats size_t as int

James Dennett via cfe-dev cfe-dev at lists.llvm.org
Wed Aug 17 07:12:37 PDT 2016

On Tue, Aug 16, 2016 at 10:51 PM, Gregory Junker via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi
> We are using libclang to parse header files and post-processing the AST.
> On Ubuntu 16.04 64-bit with the clang+llvm 3.8 download, I am seeing size_t
> come out of clang_getTypeSpelling as an int, even if I supply -m64 as an
> arg to the compiler. This seems to work fine on macOS and Windows, both
> 64-bit.
> Any thoughts?

Treating a type as `int` often indicates failure to #include something.
What do you get for decltype(sizeof(1)) ?

I don't expect that Clang would ever select `int` (a signed type) for its
size_t; this seems much more likely to be a library/code problem.  But I
could be wrong.

-- James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160817/76f41840/attachment.html>

More information about the cfe-dev mailing list