c++ - Clang. How to overcome "unknown builtin" error message -


i have program setups clang compiler instance , adds include paths using headersearchoptions class. when run parseast on input file libavutil/samplefmt.c (from ffmpeg package), following message on screen. basically, not able resolve (gcc?) builtin functions. how rid of error? in general, if setting include path through headersearchoptions, how ensure don't miss out on include paths gcc installation?

thanks!

#include "..." search starts here: #include <...> search starts here:  .  /usr/include/freetype2  /usr/include/fribidi  /usr/local/include  /usr/include/clang/basic  /opt/llvmrelease/bin/../lib/clang/3.4/include  /usr/include/i386-linux-gnu  /include  /usr/include end of search list. in file included libavutil/samplefmt.c:19: libavutil/common.h:258:12: error: use of unknown builtin '__builtin_clz'     return av_log2((x - 1) << 1);             ^ libavutil/intmath.h:89:23: note: expanded macro 'av_log2' #define av_log2       ff_log2                       ^ libavutil/intmath.h:45:29: note: expanded macro 'ff_log2' #   define ff_log2(x) (31 - __builtin_clz((x)|1))                             ^ libavutil/samplefmt.c:59:14: error: use of unknown builtin '__builtin_strlen'         if (!strcmp(sample_fmt_info[i].name, name))              ^ /usr/include/i386-linux-gnu/bits/string2.h:804:22: note: expanded macro 'strcmp'       && (__s1_len = __builtin_strlen (s1), __s2_len = __builtin_strlen (s2), \                      ^ libavutil/samplefmt.c:59:14: note: did mean '__builtin_strchr'? /usr/include/i386-linux-gnu/bits/string2.h:804:22: note: expanded macro 'strcmp'       && (__s1_len = __builtin_strlen (s1), __s2_len = __builtin_strlen (s2), \                      ^ libavutil/samplefmt.c:59:14: error: use of unknown builtin '__builtin_strcmp'         if (!strcmp(sample_fmt_info[i].name, name))              ^ /usr/include/i386-linux-gnu/bits/string2.h:807:9: note: expanded macro 'strcmp' 

something must have gone funny when did project configuration. ff_log2 code, example, inside:

#if have_fast_clz && av_gcc_version_at_least(3,4) 

so need make sure have_fast_clz isn't defined, , should ok on front. can similar things fix strcmp.


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo