Community
Participate
Working Groups
Build Identifier: 20100617-1415 There are 2 previous Eclipse bug reports that seem to be somewhat related to C99 designated initializers (39549 and 210019), but neither addresses array initialization (they focus on struct init). Reproducible: Always Steps to Reproduce: 1. Create a C or C++ file 2. Add the following code fragment: int foo[] = {[12]=123, [0]=26, 51}; 3. Notice that the parser marks the code as having a syntax error (and consequently, the code is not indexed) Please refer to http://www.drdobbs.com/184401377 for more examples of C99 initializer syntax.
It also appears that there has been a regression on Bug 39549; when I tried the structure initialization code referenced in that defect, Eclipse CDT gives me a parse error.
I cannot reproduce the problem. Also the example from bug 39549 works for me. Make sure to test with a c-file, the syntax is not supported for c++.
(In reply to comment #2) > I cannot reproduce the problem. Also the example from bug 39549 works for me. > Make sure to test with a c-file, the syntax is not supported for c++. Well that's definitely the problem then - my files are all named .cpp (and need to be named as such due to the idiosyncrasies of my particular CodeWarrior version), even though most of them are straight C. Is there any way to enable C-style parsing for certain .cpp files in a workspace? greg
(In reply to comment #3) > (In reply to comment #2) > > I cannot reproduce the problem. Also the example from bug 39549 works for me. > > Make sure to test with a c-file, the syntax is not supported for c++. > Well that's definitely the problem then - my files are all named .cpp (and need > to be named as such due to the idiosyncrasies of my particular CodeWarrior > version), even though most of them are straight C. > Is there any way to enable C-style parsing for certain .cpp files in a > workspace? > greg You should be able to do that via the langage mappings. I think there is a property page for that on project, folder and file level.