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)

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});

Revision history for this message
Jerome Abela (jerome-abela) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :

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).

Changed in vim:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Jake Mercer (milkybarkid) wrote :

Still seeing this issue in Ubuntu 20.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.