Intellisense errors in Unreal C++ project: "Cannot resolve symbol '__builtin_expect'"
Hi, at some point while working in Unreal 5.3 I started to see red underlines on all `check()`, `checkf()`, `verify()`, etc. The problem seems to be that Rider isn't recognizing some compiler intrinsic.
The project still compiles fine, but it's very distracting when coding.
This is in Rider 2024.1.2
Please sign in to leave a comment.
Hello,
Thank you for contacting Rider support.
We are sorry to hear that you encountered such a problem. Regrettably, I was not able to reproduce the issue.
Would you mind sharing additional information as described below?
Have a nice day!
As far as I remember it just started happening one day. I updated Rider to 2024.1.2 to see if it would go away, but it didn't.
I'm building UE5.3 from source, no changes to the source code.
Hello,
Thank you for the details shared.
I was able to reproduce this by adding
PublicDefinitions.Add("__clang_analyzer__=1");
to the Project.Build.cs file.There are my findings at the moment:
(__builtin_expect(!bool(false), 0) ? CA_AssumeNoReturn() : (void)0);
is an expansion of the CA_ASSUME macro;#define CA_ASSUME( Expr ) (__builtin_expect(!bool(Expr), 0) ? CA_AssumeNoReturn() : (void)0)
in:#if defined( __clang_analyzer__ )
#define USING_CODE_ANALYSIS 1
#if USING_CODE_ANALYSIS
;#else // defined(__clang_analyzer__)
__clang_analyzer__
defined while using MSVC compiler, so that the __builtin_expect is not defined;<WindowsPlatform><Compiler>Clang</Compiler></WindowsPlatform>
option in BuildConfiguration.xml.However, in with such a setup, I couldn't reproduce the issue.
To move on, I would appreciate it if you could share additional information as described below:
Meanwhile, I reported the case I found to our tracker: RSCPP-35769 __builtin_expect is not resolved in checkf() macro. UE5. You might want to have a look at this issue. It might be your case, if you have `__clang_analyzer__` defined. If so, you can disable this flag to workaround the issue.
Have a nice day!