Friday, February 28, 2014

Function '__builtin_stwio' could not be resolved

If you are using Eclipse IDE for Altera NIOS II C++ firmware development, you will probably be annoyed by the following two reported semantic error messages when you are using IOWR() and IORD() macros from the io.h:
Function '__builtin_stwio' could not be resolved for IOWR() functions in the C++ code.
Function '__builtin_ldwio' could not be resolved for IORD() function in the C++ code.

Anyway, you will still be able to load and run the firmware program in the hardware successfully and everything is working as expected.

These two error messages (builtin stwio could not be resolved and builtin ldwio could not be resolved) are however do not appear if you convert your C++ code to C code. 

But you want to write your code in C++.  The question is how to remove the two reported semantic error messages above because they are very annoying and they keep distracting you from the actual error messages?

Simple.  Go to the Windows in main menu bar.  Select Preferences.  On the left-hand column, expand C/C++.  Select Code Analysis.  Scroll down a bit on the right-hand column.  Look for the option Function cannot be resolved.  Then, it is up to you to change this setting.  You can uncheck the option for Function cannot be resolved.  Or, you can just change it to Info or Warning from the drop-down list.

Important reminder, after applying the change of the setting, don’t forget to close the Eclipse IDE and reopen it.  I noticed that without restarting the Eclipse IDE, the new setting is not effective.  After restarting the Eclipse IDE, you will notice that the two semantic error messages above are no longer reported as error.

No comments: