I have a project with C++ and C files. The code compiles and runs correctly, but I need to get rid of the following error:
Symbol 'ERANGE' could not be resolved
I was able to reproduce it with these two files (latest x64 Elipse Juno on Ubuntu):
main.h:
#ifndef MAIN_H_
#define MAIN_H_
extern "C" {
#include <errno.h>
}
#endif /* MAIN_H_ */
main.cpp:
#include <cerrno>
#include <cassert>
#include "main.h"
int main(int argc, char * argv[]) {
assert(errno != ERANGE); // <-- CDT ERROR here
return 0; }
Doing Open Declaration on ERANGE correctly takes me to /usr/include/asm-generic/errno-base.h file.
The following workarounds to similar issues DID NOT work:
The only solution that will work is disabling the Symbol is not resolved error completely, but that will cause me to miss real issues.
Edit: CDT bug filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=404017
Looks like a bug in the Eclipse CDT code analysis tool (codan). I recommend submitting a bug report here.