This forum has been archived. All content is frozen. Please use KDE Discuss instead.

kdevelop's code parser broken?

Tags: None
(comma "," separated)
Xorlium
Registered Member
Posts
17
Karma
0
OS

kdevelop's code parser broken?

Sun Nov 26, 2017 2:18 pm
Using kdevelop 5.2.1 doesn't parse some stuff correctly. Look, for example:

https://pasteboard.co/GVrl017.png

as you can see, it thinks "names" is of type const int&, but it's really const std::vector<std::string>&.

Also, some std::cout's are not recognized, but some are, which is very weird.

I'm using manjaro. The project itself uses eigen3 (linear algebra library), and I think that might be the problem, because: a) I don't get this problem with other small projects, and b) I get all these warnings:

kdevplatform.language: WARNING: Non-function type assigned to function declaration. Type is: "Eigen::half ()" whichType: 7 Declaration is: "<notype> min" "/usr/include/eigen3/Eigen/src/Core/arch/CUDA/Half.h" [ (505, 22) -> (505, 25) ]
kdevplatform.language: WARNING: Non-function type assigned to function declaration. Type is: "Eigen::half ()" whichType: 7 Declaration is: "<notype> max" "/usr/include/eigen3/Eigen/src/Core/arch/CUDA/Half.h" [ (507, 22) -> (507, 25) ]
kdevplatform.language: WARNING: Non-function type assigned to function declaration. Type is: "Eigen::AlignedBox::VectorType &() const" whichType: 7 Declaration is: "invalid member-function min type const Eigen::AlignedBox::VectorType &() const" "/usr/include/eigen3/Eigen/src/Geometry/AlignedBox.h" [ (105, 46) -> (105, 49) ]
kdevplatform.language: WARNING: Non-function type assigned to function declaration. Type is: "const Eigen::AlignedBox::VectorType &() const" whichType: 7 Declaration is: "invalid member-function min type Eigen::AlignedBox::VectorType &() const" "/usr/include/eigen3/Eigen/src/Geometry/AlignedBox.h" [ (105, 46) -> (105, 49) ]
kdevplatform.language: WARNING: Non-function type assigned to function declaration. Type is: "Eigen::AlignedBox::VectorType &()" whichType: 7 Declaration is: "invalid member-function min type Eigen::AlignedBox::VectorType &()" "/usr/include/eigen3/Eigen/src/Geometry/AlignedBox.h" [ (107, 40) -> (107, 43) ]
kdevplatform.language: WARNING: Non-function type assigned to function declaration. Type is: "Eigen::AlignedBox::VectorType &() const" whichType: 7 Declaration is: "invalid member-function max type const Eigen::AlignedBox::VectorType &() const" "/usr/include/eigen3/Eigen/src/Geometry/AlignedBox.h" [ (109, 46) -> (109, 49) ]
kdevplatform.language: WARNING: Non-function type assigned to function declaration. Type is: "const Eigen::AlignedBox::VectorType &() const" whichType: 7 Declaration is: "invalid member-function max type Eigen::AlignedBox::VectorType &() const" "/usr/include/eigen3/Eigen/src/Geometry/AlignedBox.h" [ (109, 46) -> (109, 49) ]
kdevplatform.language: WARNING: Non-function type assigned to function declaration. Type is: "Eigen::AlignedBox::VectorType &()" whichType: 7 Declaration is: "invalid member-function max type Eigen::AlignedBox::VectorType &()" "/usr/include/eigen3/Eigen/src/Geometry/AlignedBox.h" [ (111, 40) -> (111, 43) ]
QWidget::insertAction: Attempt to insert null action
QWidget::insertAction: Attempt to insert null action
kdevelop.languages.clang: Unhandled type: Complex _Complex __float128
kdevelop.languages.clang: Unhandled type: Complex _Complex __float128
kdevelop.languages.clang: Unhandled type: Complex _Complex __float128


I don't know if it's a bug in kdevelop or what. The program compiles and runs fine, by the way.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: kdevelop's code parser broken?

Sun Nov 26, 2017 3:05 pm
Can you look in the "Problems" toolview, is there anything interesting there?
Somehow it doesn't seem to find/parse the STL headers correctly, that's why it does this. That's a bug, it should work.

Otherwise, it might be useful to run "KDEV_CLANG_DISPLAY_DIAGS=1 kdevelop" and paste the full output somewhere ...


I'm working on the KDevelop IDE.
Xorlium
Registered Member
Posts
17
Karma
0
OS

Re: kdevelop's code parser broken?

Sun Nov 26, 2017 7:45 pm
Hi,

Thank you for the reply. The problems tab does indeed contain some error and warnings, such as "undeclared identifier" of many variables. Remember, the project compiles and runs well.

Here is the first part of a 17600 line log:
https://pastebin.com/BESFnyAY

Then it goes into many, many more lines, similar to the ones above, for basically every file in the std, saying "maximum template recursion exceeded" for everything.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: kdevelop's code parser broken?

Sun Nov 26, 2017 7:53 pm
Go to your project settings, and under "Language support" -> "C/C++ parser" change the value of the dropdown list "Compiler for path" (at the bottom). Does it work with whatever is not currently selected there?


I'm working on the KDevelop IDE.
Xorlium
Registered Member
Posts
17
Karma
0
OS

Re: kdevelop's code parser broken?

Mon Nov 27, 2017 5:28 am
No :(

I had already done this.

If I choose "GCC" (which was what was open anyway), I get the errors I've been mentioning.

If I choose clang or None, I get things like "vector not found" with my #include <vector> (for every std include).

Weird. I have clang 5.0.0 and GCC 7.2.0, which is the default for manjaro. Maybe something related to it being multilib? Or that I have both gcc 7.2 and 6.4 installed? I don't know.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: kdevelop's code parser broken?

Mon Nov 27, 2017 7:10 pm
Xorlium wrote:Or that I have both gcc 7.2 and 6.4 installed?


That would be thinkable ... can we test this, i.e. uninstall one or the other of them?


I'm working on the KDevelop IDE.
Xorlium
Registered Member
Posts
17
Karma
0
OS

Re: kdevelop's code parser broken?

Tue Nov 28, 2017 2:12 am
Hi,

Sorry to take so long to reply, I was pretty busy today.

Anyway, I uninstalled gcc6 and all its dependencies and I get exactly the same behavior.

In any case, my other projects are working fine. I don't know what's wrong with this particular one.

But if you want to check where it fails, here is my project:
https://github.com/mraggi/FuzzyLogicEcology

Check, for example, the file "FuzzyNetworkBase.hpp", the very first defined function: "PrintEverything" has a vector<string>& names. For me, that one registers as const int&. No matter if I erase all the cache, if I download from git a clean copy, etc. If I remove enough stuff to make it look like an example, it parses it correctly, so I'm thinking the error is about the complexity of the code.

Bear in mind the project itself is highly specialized, so it'll probably not be easy to understand what the code wants to do, and is very much still in progress. Also, it only works in linux, probably. I don't know, I haven't tested it anywhere else.

Edit: I remembered I had a computer running the previous version of kdevelop: 5.2. So I tried in that one, and it parses it correctly. But when I upgraded it to 5.2.1, it failed to parse.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: kdevelop's code parser broken?

Tue Nov 28, 2017 11:44 am
Hm, so this broke for you in 5.2.1? Interesting. Did you use the AppImage or distro packages?


I'm working on the KDevelop IDE.
Xorlium
Registered Member
Posts
17
Karma
0
OS

Re: kdevelop's code parser broken?

Tue Nov 28, 2017 1:06 pm
I tried with both. It's broken with both.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: kdevelop's code parser broken?

Tue Nov 28, 2017 1:13 pm
Yeah, I tried to, can't make it worth either. Very strange, since I don't see anything odd about this project.


I'm working on the KDevelop IDE.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]