In my Simplicity Studio 5 (Windows 10) project for BGM13S, every 'sl_app_assert' is underlined and a question mark on left indicates a syntax error.
I have the uart logs enabled and I see that the error is generated by the 'printf("[%s] ", __func__);' line in the macro expansion. It seems the IDE parser does not recognize __func__ , because the code actually compiles and runs correctly.
What could the reason for that behavior be? How can I get read of this false error messages?
Regards
Discussion Forums
Simplicity Studio
Answered
Answered
Hi Vankata,
That is a strange issue we see with the Eclipse Indexer included in Simplicity Studio. To get rid of those syntax errors, go to [Preferences] > [C/C++] > [Language Mappings] and click [Add...] and add an entry for [C Source File] [GNU C]:
The indexer will run after hitting [Apply and Close] and the syntax errors should be removed. As best I understand '__func__' is a GCC magic constant and the indexer needs to be told which language is being used by the projects, you can see other options besides GNU C, such as GNU C with IAR extensions, etc in the Add function Language dropdown.
It seems __func__ generates syntax error?
Hello,
In my Simplicity Studio 5 (Windows 10) project for BGM13S, every 'sl_app_assert' is underlined and a question mark on left indicates a syntax error.
I have the uart logs enabled and I see that the error is generated by the 'printf("[%s] ", __func__);' line in the macro expansion. It seems the IDE parser does not recognize __func__ , because the code actually compiles and runs correctly.
What could the reason for that behavior be? How can I get read of this false error messages?
Regards
Hi Vankata,
That is a strange issue we see with the Eclipse Indexer included in Simplicity Studio. To get rid of those syntax errors, go to [Preferences] > [C/C++] > [Language Mappings] and click [Add...] and add an entry for [C Source File] [GNU C]:
The indexer will run after hitting [Apply and Close] and the syntax errors should be removed. As best I understand '__func__' is a GCC magic constant and the indexer needs to be told which language is being used by the projects, you can see other options besides GNU C, such as GNU C with IAR extensions, etc in the Add function Language dropdown.
Let me know if that resolves the issue for you.
Thank you,
jpitt
Yes, it worked!
Thank you, jpitt!