| Summary: | KDevelop editor doesn't parse C99 compound literals | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Leandro Santiago da Silva <leandrosansilva> |
| Component: | Language Support: CPP (old) | Assignee: | kdevelop-bugs-null |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | normal | CC: | nalvarez, rushpl |
| Priority: | NOR | ||
| Version First Reported In: | git master | ||
| Target Milestone: | 4.0.1 | ||
| Platform: | Ubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
This is actually called a "compound literal". This doesn't work for me as well, as shown on the screenshot: http://rushbase.net/stuff/kdevelop_weird_problems.png |
Version: SVN (using KDE 4.4.5) OS: Linux In my project I'm using a struct type called AVRational: typedef struct AVRational{ int num; ///< numerator int den; ///< denominator } AVRational; And declare an AVRational: AVRational i; If I try to set this struct: i = (AVRational){1,10}; KDevelop editor doesn't parse this instruction. I think this syntax is correct in c/c++ because the program compiles fine. Reproducible: Didn't try Steps to Reproduce: Create a new C file with this contents: #include <stdio.h> typedef struct MyStruct { int num; int den; } MyType; int main() { MyType i; i = (MyType){1,13}; printf("%d and %d\n",i.num,i.den); return 1; } And compiles with: gcc teste.c -o teste -Wall Or: clang teste.c -o teste Or: tcc teste.c -o teste I've used just these three compilers and all them compile fine and don't show any warning messages.