How can clang avoid to analyze the builtin type/function in C/C++?

648 views Asked by At
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/stdarg.h:40:9: error: unknown type name '__builtin_va_list'; did you mean '__builtin_va_list'?
typedef __builtin_va_list __gnuc_va_list;
        ^
note: '__builtin_va_list' declared here

When I try to use the RecursiveASTVisitor to visit the AST, I got the above problem. And at the end, the program abort with the following message.

  type: Typedef of __gnuc_va_list size CItutorial5: /home/lotay/libs/clang/llvm/include/llvm/Support/Casting.h:239: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = clang::ConstantArrayType, Y = const clang::Type]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
Aborted (core dumped)

Really thanks for help

and I have the langoptions with following confs.

   langOpts.GNUMode          = 1 ;
   langOpts.CXXExceptions    = 1 ;
   langOpts.RTTI             = 1 ;
   langOpts.Bool             = 1 ;
   langOpts.CPlusPlus        = 1 ;
   langOpts.WChar            = 1 ;
0

There are 0 answers