I’m currently using vscode clang-format with a .clang-format config file of my own. I already succeeded to automatically have return type on a different line with the parameter :
AlwaysBreakAfterReturnType: AllDefinitions
But, even more now that C23 introduced more function attributes in the standard, I would like to separate on (at least 2) different lines the function attributes and the return type. For example, this :
[[nodiscard]] static inline double
foo() ...
Should become this :
[[nodiscard]] static inline
double
foo() ...
I understand that, because of some intricacies of the C language that I’m not aware of, some attributes could have double meanings leading to an impossibility to format this way. So, if this is not possible for clang-format, is there at least a way to deactivate specifically this part ?
I already tried the options listed on clang website and it always default to format on the same line everything or format only the name of the function on a second line.