Skip to content

C/C++ linter does not support "%b" specifier in printf-formatted strings #700

Description

@Magyar57

The linter (syntax coloring) for formatted strings displays an "error" (red character) for the %b specifier in C, even though this specifier is now supported since C23

Steps to reproduce:

  1. touch printf_linter_bug.c && code printf_linter_bug.c
  2. Paste:
int main(){
	printf("%b \n", 0x7f);
	return 0;
}

We observe that the '%' is coloured in red and the b in the string colour, whereas a correctly supported identifier (e.g. "%d") would show both in blue

This is valid C23 code, which you can check by compiling (with an up to date compiler): clang -std=c23 printf_linter_bug.c -o printf_linter_bug && ./printf_linter_bug (the command succeeds)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions