Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Avoid "Syntaxis error" for Concat ## this ##
Avoid "Syntaxis error" for Concat ## this ## [message #1069453] Mon, 15 July 2013 19:05 Go to next message
Eclipse UserFriend
Hi,

Do you know how disable or create an exception to avoid the static code analysis tool embedded in eclipse mark the concatenation at precompilation?

#define mNiceMacro(this, value) {concat##this## = value;}



void UglyFunction_UsingConcat(void)
{
/*code*/
mNiceMacro(5, 7); /*here we get a syntaxis error,but the compilation is
/* done without errors */
/*more code*/
}
Re: Avoid "Syntaxis error" for Concat ## this ## [message #1069556 is a reply to message #1069453] Tue, 16 July 2013 01:50 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ivan,

if you mean 'Codan' as the 'static code analysis tool', I have switched it completely OFF.

Regards
Dirk
Re: Avoid "Syntaxis error" for Concat ## this ## [message #1069883 is a reply to message #1069556] Tue, 16 July 2013 15:55 Go to previous messageGo to next message
Eclipse UserFriend
Dirk,

Yes, I use codan as static analysis tool and I turned off. but I still have the false positive "syntaxis error" in fact the icon does not looks like a codan icon, I was thinking the syntaxis error is throw by other plugin.
Re: Avoid "Syntaxis error" for Concat ## this ## [message #1070050 is a reply to message #1069453] Wed, 17 July 2013 02:41 Go to previous messageGo to next message
Eclipse UserFriend
Ivan Galicia wrote on Tue, 16 July 2013 01:05
Hi,

Do you know how disable or create an exception to avoid the static code analysis tool embedded in eclipse mark the concatenation at precompilation?

#define mNiceMacro(this, value) {concat##this## = value;}



void UglyFunction_UsingConcat(void)
{
/*code*/
mNiceMacro(5, 7); /*here we get a syntaxis error,but the compilation is
/* done without errors */
/*more code*/
}

The error arises not from the code analysis CODAN but from the indexer. You can disable the indexer for this code part by using
#ifndef __CDT_PARSER__
...
#endif


BTW, this code does not compile on my platform (Linux gcc 4.6). This might be the reason the indexer chokes.
Re: Avoid "Syntaxis error" for Concat ## this ## [message #1083211 is a reply to message #1070050] Fri, 09 August 2013 12:33 Go to previous messageGo to next message
Eclipse UserFriend
Add the _CDT_PARSER_ sentence, but I got the same results.
look like the way that we wrote the macro is trigger the syntaxis error.
Re: Avoid "Syntaxis error" for Concat ## this ## [message #1084903 is a reply to message #1083211] Mon, 12 August 2013 03:41 Go to previous messageGo to next message
Eclipse UserFriend
Ivan Galicia wrote on Fri, 09 August 2013 18:33
Add the _CDT_PARSER_ sentence, but I got the same results.
look like the way that we wrote the macro is trigger the syntaxis error.

Where did you insert _CDT_PARSER_? You should surround the macro definition (and provide an empty definition for the #else clause)
Re: Avoid "Syntaxis error" for Concat ## this ## [message #1085203 is a reply to message #1084903] Mon, 12 August 2013 11:37 Go to previous message
Eclipse UserFriend
Axel,
I did it, same result.

#ifndef __CDT_PARSER__

#define mNiceMacro(this, value) {concat##this## = value;}

#endif
Previous Topic:building llvm with eclipse
Next Topic:Running indexer from command line error
Goto Forum:
  


Current Time: Thu May 22 03:50:07 EDT 2025

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

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

Back to the top