Skip to main content


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 21:05 Go to next message
Paul Clegg is currently offline Paul CleggFriend
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 14:35 Go to previous messageGo to next message
Ivan Galicia is currently offline Ivan GaliciaFriend
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 15:49 Go to previous messageGo to next message
Paul Clegg is currently offline Paul CleggFriend
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 08:16 Go to previous messageGo to next message
Lanna Joka is currently offline Lanna JokaFriend
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] Tue, 27 August 2013 00:09 Go to previous message
Sergey Bobkov is currently offline Sergey BobkovFriend
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 Apr 19 02:16:09 GMT 2024

Powered by FUDForum. Page generated in 0.01748 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top