| Summary: | KDevelop cannot recognize std::printf, but recognizes ::printf | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Alexander <ashaduri> |
| Component: | Language Support: CPP (old) | Assignee: | kdevelop-bugs-null |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | normal | CC: | damir_porobic, smihael |
| Priority: | NOR | ||
| Version First Reported In: | git master | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Screenshot showing error | ||
Same with <cstdarg> and std::va_list. Hovering over cstdarg shows: cstdarg path: /usr/include/c++/4.3/cstdarg Included: 0 Included by: 5 Defined macros: 10 Declarations: Typedef __gnuc_va_list, Typedef va_list The problem seems to be gone after removing ~/.kdevduchain. I still get random squiggles (parts of the standard facilities from a header recognized, other parts not) which are usually resolved by opening the respective standard headers (both C and C++ ones, like stdio.h and cstdio), then pressing F5 on them and the affected file. Probably a different bug? (kinda hard to reproduce). I have tried several ways to reproduce this, including project open or not, new file or not, but have not been successful with kdevelop 4.0. Please reopen if you are still experiencing this. Reopen. I'm having the same trouble with KDevelop Version 4.6.0 using KDE Development Platform 4.13.3. Even though I included #include <stdio.h> #include <string> I get following "errors" (it compiles fine, just the code completion doesn't work and code hinting gives wrong information) Problem in Semantic Analysis: Declaration not found: printf Problem in Semantic Analysis: Declaration not found: string::npos Problem in Semantic Analysis: Declaration not found: begin It doesn't matter if I use std namespace directly or by using command. *** Bug 364636 has been marked as a duplicate of this bug. *** Created attachment 99658 [details]
Screenshot showing error
Comment on attachment 99658 [details]
Screenshot showing error
Looks like I've got the same or similar error. I'm running KDevelop 4.7.1, KDE Development Platform 4.14.18.
Everything compiles fine but just the editor gives the same error and after opening the header files where the functions are defined and refreshing it was gone.
|
Version: SVN (using KDE 4.3.0) Compiler: gcc 4.3.2 OS: Linux Installed from: SuSE RPMs For some reason, the SVN version of KDevelop (r1011610) + KDevPlatform (r1011577) doesn't recognize the following: #include <cstdio> #include <cstdlib> void f() { std::printf("hello"); // squiggles under std::printf std::abort(); // no squiggles here } If I change std::printf to printf or ::printf, the squiggles go away. fprintf, fopen, etc... are also affected. This seems to happen only with cstdio, not with cstdlib or any other headers I've used. Hovering mouse over <cstdio> shows: cstdio path: /usr/include/c++/4.3/cstdio Included: 6 Included by: 3 Defined macros: 366 Declarations: Typedef fpos_t, Typedef fpos64_t, Variable stdin, Variable stdout, Variable stderr, Function remove, Function rename, Function renameat, Function tmpfile, Function tmpfile64, Function tmpnam, Function tmpnam_r, Function tempnam, Function fclose, Function fflush, Function fflush_unlocked, Function fcloseall, Function fopen, Function freopen, Function fopen64, Function freopen64, Function fdopen, Function fopencookie, Function fmemopen, Function open_memstream, Function setbuf, Function setvbuf, Function setbuffer, Function setlinebuf, Function fprintf, Function printf, Function sprintf, .... and so on... Hovering over cstdlib, however, shows: cstdlib path: /usr/include/c++/4.3/cstdlib Included: 3 Included by: 3 Defined macros: 0 Declarations: std, __gnu_cxx, std, std::div_t, std::ldiv_t, std::abort, std::abs, std::atexit, std::atof, ... That is, cstdlib shows stuff from std:: namespace, while cstdio shows stdio.h contents.