On 31.07.2023 17:11, Luca Fancellu wrote: >>> + { >>> + "rel_path": "arch/x86/include/asm/bug.h", >>> + "comment": "Includes mostly assembly macro" >>> + }, >> >> Mind me asking why assembly macros wouldn't want maintaining in proper >> style? > > From what I know (experts on CF correct me if I am wrong) clang-format is > meant to format only some languages > (C/C++/...) and assembly is not one of them, so what is happening is that > most of the time clang-format breaks > it, in fact we are formatting only .c and .h, but since we have some headers > with assembly macros, I’ve seen some issues > that ranges from really ugly formatting to build break. > > One thing we could do, is to export the headers that contain only assembly > stuffs in dedicate headers (<header>_asm.h ?) > so that we could easily use a name regex to exclude "*_asm.h” from > clang-format? And also these headers could #error if > included when __ASSEMBLY__ is not defined?
In principle this may be a route to go (naming aside), but first of all I wonder what "assembler macros" are to you: We use both C macros and true assembler macros in assembly code. The former I would hope formatting tools don't have an issue with. Jan