Version: Current CVS version (using KDE KDE 3.1.1) Installed from: Gentoo Packages Compiler: gcc 3.2.2 OS: Linux hi, the gideon problem reporter shows correct as problematic. however the line is perfectly ok and compiles fine. To reproduce the bug add the following structure to a class header file : struct NEXT_MOVE { int orientation; // TOP, RIGHT, BOTTOM, LEFT int srcX; int srcY; int destX; int destY; bool movePossible; bool fromOutside; } nextMove; now add the following line somewhere in the class implementation : nextMove = (NEXT_MOVE) { 0, 0, 0, 0, 0, true, true }; The reporter shows the line as bad and gives the following reason : ';' expected found '{' ';' expected found '}' the bug is present in the current cvs version. bye, Andreas
I can confirm this behaviour - and also that it is bad. Though, this is a problem in the underlying parser (which thinks there is an error ), not in the problem reporter (which would be the case, if it reported i.e. "FooBar is undefined" when FooBar is actually defined and parsed)
yes the bug is simple:it interprets "{" as a start of a composed instruction( begin-end from pascal).I have vers 3.1.2 of KDevelop
Created attachment 8783 [details] a c++ code where the bug apears if u define a struct struct STR { int/*any type*/ member1,member2; }; a use like STR str={1,2};//here there is no problem str=(STR){5,6};//the problem is here :)
Changing description to make the report more general. See the dupes for more examples.
*** Bug 60763 has been marked as a duplicate of this bug. ***
*** Bug 60774 has been marked as a duplicate of this bug. ***
*** Bug 60262 has been marked as a duplicate of this bug. ***
*** Bug 71536 has been marked as a duplicate of this bug. ***
*** Bug 108215 has been marked as a duplicate of this bug. ***
*** Bug 136464 has been marked as a duplicate of this bug. ***
*** Bug 63216 has been marked as a duplicate of this bug. ***
*** Bug 108667 has been marked as a duplicate of this bug. ***
A simple yet important example that I haven't seen in the dupes is the following: if (a*b < c) foo(); If it helps as a hint, only the * operator signals the problem (not +, - or /).
I'm tempted to close this as wontfix, KDevelop is a C++ IDE first and foremost and thus you can expect problems when using C syntax thats not part of the C-subset of C++. But I'm just changing it to a wishlist item for a C language plugin.
Note however that simple C should be quite usable with our C++ support, and I think it's ok improving kdevelop a bit more so it works good with C, once C++ is "ready".
*** Bug 187783 has been marked as a duplicate of this bug. ***
C99 designated initializers. Because bug 187783 was closed, I'm putting this example here: struct foobar { int foo; int bar; }; struct foobar fb = { .bar = 10, .foo = 20 };
The SSE intrinsics headers distributed with GCC use compound literals, so including xmmintrin.h, even from standards-conforming C++, produces spurious "Problems".
It may not be standard, but compound literals in C++ are supported by g++, Intels icpc, MS and IBM compilers. And I use this kind of construct rather often, as it is extremly handy when writing SSE code :-)
*** Bug 270319 has been marked as a duplicate of this bug. ***
*** Bug 246026 has been marked as a duplicate of this bug. ***
Moving all the bugs from the CPP Parser. It was not well defined the difference between it and C++ Language Support and people kept reporting in both places indistinctively
*** Bug 302589 has been marked as a duplicate of this bug. ***
Git commit 70834035889654703d9b3eca2c4951a03a0eda53 by Sergey Kalinichev. Committed on 08/03/2016 at 06:05. Pushed by skalinichev into branch '5.0'. Parse C files in C mode Now there are 2 language profiles: one for C++, another one for C. The language type is determined by mime type. Since *.h files used in C and C++, by default they are parsed in C++ mode, to change that behavior there is a "Parse *.h headers in plain C" check-box. Related: bug 357774, bug 357615 Differential revision: https://phabricator.kde.org/D1047 M +1 -1 languages/clang/clangparsejob.cpp M +5 -0 languages/clang/clangsettings/clangsettingsmanager.cpp M +2 -0 languages/clang/clangsettings/clangsettingsmanager.h M +1 -1 languages/clang/duchain/parsesession.cpp M +2 -1 languages/clang/tests/test_duchain.cpp M +0 -1 languages/clang/tests/test_files.cpp M +12 -2 languages/plugins/custom-definesandincludes/compilerprovider/compilerprovider.cpp M +64 -9 languages/plugins/custom-definesandincludes/compilerprovider/settingsmanager.cpp M +33 -2 languages/plugins/custom-definesandincludes/compilerprovider/settingsmanager.h M +15 -6 languages/plugins/custom-definesandincludes/definesandincludesmanager.cpp M +1 -0 languages/plugins/custom-definesandincludes/definesandincludesmanager.h M +2 -2 languages/plugins/custom-definesandincludes/idefinesandincludesmanager.h M +57 -24 languages/plugins/custom-definesandincludes/kcm_widget/parserwidget.cpp M +6 -3 languages/plugins/custom-definesandincludes/kcm_widget/parserwidget.h M +120 -8 languages/plugins/custom-definesandincludes/kcm_widget/parserwidget.ui M +4 -3 languages/plugins/custom-definesandincludes/kcm_widget/projectpathsmodel.cpp M +1 -1 languages/plugins/custom-definesandincludes/kcm_widget/projectpathsmodel.h M +3 -2 languages/plugins/custom-definesandincludes/kcm_widget/projectpathswidget.cpp M +1 -1 languages/plugins/custom-definesandincludes/tests/test_definesandincludes.cpp http://commits.kde.org/kdevelop/70834035889654703d9b3eca2c4951a03a0eda53