| Summary: | The float-versions of the math-functions are not indexed. | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Missing name <Liganic> |
| Component: | cdt-indexer | Assignee: | Markus Schorn <mschorn.eclipse> |
| Status: | RESOLVED FIXED | QA Contact: | Markus Schorn <mschorn.eclipse> |
| Severity: | major | ||
| Priority: | P3 | CC: | cdtdoug, eclipse.sprigogin |
| Version: | 8.0 | ||
| Target Milestone: | 8.1.0 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
Parser? Or Indexer? > Parser? Or Indexer?
I am not sure about the difference but in the test case the errors are marked red in the code since sqrtf is provided by glibc under C99 and thus not explicitly declared in a header file. Environment is current Arch Linux.
The code example is C++, not C99? In any way, 'sqrtf' is defined in math.h and is found correctly in my environment. In case the include-search path is setup correctly and you do see the problem, try to create a self-contained example (e.g. by copying the necessary system-headers into a project) and attach it to the bug. > The code example is C++, not C99? The code is C++ but only functions which need --std=c99 seem to be broken. To be precise sqrtf, fabsf etc. > In any way, 'sqrtf' is defined in math.h and is found correctly in my > environment. In case the include-search path is setup correctly and you do see > the problem, try to create a self-contained example (e.g. by copying the > necessary system-headers into a project) and attach it to the bug. I am not sure how to narrow it down. I tried in a freshly installed Ubuntu system and it works (as expected) but F3 on sqrtf brings me to sqrt(!) in mathcalls.h while F3 in Arch just says that sqrtf is not in the index. The same sqrt exists in mathcalls.h on my system in the set include path (/usr/include/bits/) but somehow CDT doesn't recognize it for sqrtf. The only difference is: Ubuntu uses eglibc and Arch Linux glibc. The standard headers use the following pattern:
mathcalls.h:
__MATHCALL (sqrt,, (_Mdouble_ __x));
math.h:
#define __MATHCALL(function, suffix, args) \
extern _Mdouble_ __MATH_PRECNAME(function,suffix) args
#define _Mdouble_ double
#define __MATH_PRECNAME(name,r) name##r
#include "mathcalls.h"
#undef _Mdouble_
#undef __MATH_PRECNAME
#define _Mdouble_ float
#define __MATH_PRECNAME(name,r) name##f##r
#include "mathcalls.h"
#undef _Mdouble_
#undef __MATH_PRECNAME
This pattern is not yet covered by fix for bug 197989, see bug 197989 comment 95
(In reply to comment #5) > This pattern is not yet covered by fix for bug 197989, see bug 197989 comment > 95 Is there a temporary work-around available which doesn't modify the code? Implemented as discussed in bug 197989 comment 95. I have optimized storing the significant macro dictionaries, with that the performance penalty in my boost test project is less than 5%. *** cdt git genie on behalf of Markus Schorn ***
Bug 362442: Considering all expansions for significant macros.
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=2dea3d4a339d49579b06d13399e66adb03556fd8
|
Build Identifier: M20110909-1335 Minimalistic test case: #include <iostream> #include <math.h> using namespace std; int main() { cout<<sqrtf(3)<<endl; return 0; } produces: Function 'sqrtf' could not be resolved Invalid overload of 'endl' However the code compiles fine through eclipse. Reproducible: Always