[cfe-dev] __builtin_index not recognized.
Chris Lattner
clattner at apple.com
Mon Apr 19 18:32:18 PDT 2010
added in r101858.
On Apr 18, 2010, at 2:51 PM, Enea Zaffanella wrote:
> Hello.
>
> The following program fragment, which compiles cleanly using GCC,
> produces the following error with clang++:
>
> $ cat bug.cc
> char* idx(char *s, int c) {
> return __builtin_index(s, c);
> }
>
>
> $ clang++ -fsyntax-only bug.cc
> bug.cc:2:10: error: use of undeclared identifier '__builtin_index'
> return __builtin_index(s, c);
> ^
> 1 error generated.
>
>
> Looking into include/clang/Builtins.def, we find
>
> LIBBUILTIN(index, "c*cC*i", "f", "strings.h")
> LIBBUILTIN(rindex, "c*cC*i", "f", "strings.h")
>
> but there are no corresponding lines for __builtin_index and
> __builtin_rindex.
>
> Regards,
> Enea Zaffanella.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
More information about the cfe-dev
mailing list