Closed as not planned
Closed as not planned
Description
Let this be the file, unformatted.c
, to be formatted in the examples:
int main(int argc , char * argv [] ) {
int * thing;
int *eee;
}
This will not format the C code at all as clang-format
returns Configuration file(s) do(es) not support C++:
---
Language: C
IndentWidth: 9
PointerAlignment: Left
Adding BaseOnStyle: LLVM
to the top of the file will run without an error, but the custom settings defined are ignored:
BasedOnStyle: LLVM
---
Language: C
IndentWidth: 9
PointerAlignment: Left
Formatted file:
int main(int argc, char *argv[]) {
int *thing;
int *eee;
}
For some reason, changing Language: C
to use Cpp works.
BasedOnStyle: LLVM
---
Language: Cpp
IndentWidth: 9
PointerAlignment: Left
Formatted file:
int main(int argc, char* argv[]) {
int* thing;
int* eee;
}
Why is Language: C
ignored?
clang-format version:
$ clang-format-21 --version
Debian clang-format version 21.0.0 (++20250612091244+3f0cf742ac4e-1~exp1)