vim c syntax does not support ansi anonymous array
Bug #137917 reported by
Jerome Abela
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vim (Ubuntu) |
Triaged
|
Low
|
Unassigned |
Bug Description
Binary package hint: vim-runtime
When editing the following file, which use a standard ANSI syntax, the syntax highlighting is wrong for every curly brackets starting at the anonymous array.
#include <stdio.h>
int main() {
printf("%p\n", (int[]){42});
}
To post a comment you must log in.
Confirmed. I don't think it's a bug that this happens by default, since ':help c.vim' documents ':let c_no_c99=1' as a way to permit C99 standard items and compound literals are new in C99. However, setting c_no_c99 is not sufficient to remove the error highlighting on the braces here, and it should be.
As a workaround, you can run ':let c_no_curly_error=1' before setting the syntax (or in .vimrc).