Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Code analysis error: Function '__sync_bool_compare_and_swap' could not be resolved
Code analysis error: Function '__sync_bool_compare_and_swap' could not be resolved [message #1077528] Thu, 01 August 2013 17:05 Go to next message
Paul Clegg is currently offline Paul Clegg
Messages: 2
Registered: August 2013
Junior Member
Code analysis is not able to resolve any of the GCC atomic builtin functions (gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html).

Code example:

bool foo(false);
while(!__sync_bool_compare_and_swap(&foo, false, true)) {}

I have 'Automated discovery of paths and symbols' enabled for 'GCC C++ Compiler' in C/C++ Build -> Discovery Options

Is there something else I'm missing to get these to cleanly resolve?

TIA
Re: Code analysis error: Function '__sync_bool_compare_and_swap' could not be resolved [message #1078096 is a reply to message #1077528] Fri, 02 August 2013 10:35 Go to previous messageGo to next message
Ivan Galicia is currently offline Ivan Galicia
Messages: 17
Registered: September 2012
Junior Member
Paul,
I have a similar issue, I add the path in to the "preprocessor include path"->Entries.

I hope this works for you..
Regards
Re: Code analysis error: Function '__sync_bool_compare_and_swap' could not be resolved [message #1078149 is a reply to message #1078096] Fri, 02 August 2013 11:49 Go to previous messageGo to next message
Paul Clegg is currently offline Paul Clegg
Messages: 2
Registered: August 2013
Junior Member
I added it manually to:

C/C++ General -> Preprocessor Include Paths -> Entries -> CDT User Setting Entries

and it solved the problem, but is there a way to configure the CDT GCC Built-in Compiler Settings provider to discover these GCC built-in functions automatically?
Re: Code analysis error: Function '__sync_bool_compare_and_swap' could not be resolved [message #1082933 is a reply to message #1078149] Fri, 09 August 2013 04:16 Go to previous messageGo to next message
Lanna Joka is currently offline Lanna Joka
Messages: 1
Registered: August 2013
Junior Member
Hi, can both of you be more specifix about the solution?

I encoutered a same problem and I'm looking for a quick fix of this !
Re: Code analysis error: Function '__sync_bool_compare_and_swap' could not be resolved [message #1095340 is a reply to message #1077528] Mon, 26 August 2013 20:09 Go to previous message
Sergey Bobkov is currently offline Sergey Bobkov
Messages: 1
Registered: August 2013
Junior Member
The same problem. Tried -march key in compiler settings but it didn't work out. Looks a bit weird that your include solves the problem as this built-in function doesn't have any header file to be included.
Previous Topic:Toolchain config.
Next Topic:Change the contents of the Code Composer Studio ".cproject" file
Goto Forum:
  


Current Time: Fri Aug 29 10:25:23 EDT 2014

Powered by FUDForum. Page generated in 0.01685 seconds