DaanDeMeyer wrote: > I'm open to adding options that make sense, but I don't see the rationale > behind having different pointer alignments in function declarations ( e.g. > `int* foo(int *)`) and type casts (e.g. `(int*)`).
For variable declarations, the pointer is semantically attached to the variable name as the variable name is a pointer to a value of the given type, so we align the pointer right for variables in systemd. It also makes much more sense to align right when you declare multiple pointer variables on the same line, which is something we do in systemd. For function return types and c style casts, there is no variable name to attach the pointer to. And attaching the pointer to the function name doesn't make much sense, as the functionis not a pointer to a value, but returns a pointer to a value instead. So we decided that for these cases, it makes more sense to align the pointer left. In the end all of this is bikeshedding though. Practically we can't adopt clang-format in systemd unless it formats code mostly like our style guide, and this feature is required to allow clang-format to adhere to our style guide. https://github.com/llvm/llvm-project/pull/169160 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
