| Summary: | C++ parser doesn't correctly parse time.h | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Gerhard <gstengel> |
| Component: | Language Support: CPP (old) | Assignee: | kdevelop-bugs-null |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | guido-kdebugs, nalvarez |
| Priority: | NOR | ||
| Version First Reported In: | 4.0.0 | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
I can confirm this bug. Also, the parser has similar problems with other types declared in time.h, for example time_t. I didn't investigate yet, but I suspect this is the same problem as bug 237420. Dear Bug Submitter, This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond. Thank you for helping us make KDE software even better for everyone! I just tested the code snippet above with kdevelop 5.3.0, and yes, it finally works :-) Thanks for the confirmation! |
Version: 4.0.0 (using KDE 4.4.3) OS: Linux Installed from: openSUSE RPMs Consider following code snippet: #include <iostream> #include <iomanip> #include <time.h> using namespace std; int main(int argc, char **argv) { tm *p_tm; timespec current_time; clock_gettime(CLOCK_REALTIME, ¤t_time); p_tm = localtime(¤t_time.tv_sec); cout << "current time: " << setw(2) << p_tm->tm_hour << ":" << setw(2) << p_tm->tm_min << ":" << setw(2) << p_tm->tm_sec << endl; } The C++ parser complains it can't find the declarations of clock_gettime, CLOCK_REALTIME and localtime. However, if I move the include of <time.h> to the first place, the example is correctly parsed.