[PATCH v6 0/4] Add include guard checker and reformatter
Tom Tromey
tromey@adacore.com
Fri Dec 13 14:39:11 GMT 2024
>>>>> "Tom" == Tom Tromey <tromey@adacore.com> writes:
Tom> Here's v6 of the series. I believe it addresses all the review
Tom> comments.
Tom> I reordered the series little, since it makes more sense to enable
Tom> pre-commit as the last step.
I've updated this series locally -- in particular I changed the script
to allow certain headers to be excluded from the check. This was needed
to bypass gdbsupport/unordered_dense.h, which doesn't follow local
header rules because it isn't really maintained as part of gdb.
One oddity I've thought of is that this script means that pure header
file moves aren't really possible any more. For example, a hypothetical
"gdb/x.h" will use a header guard of "GDB_X_H"; but if it is then moved
to gdbsupport, the guard will change to "GDBSUPPORT_X_H" -- requiring an
edit during the move.
I personally don't care about this but I figured I should point it out.
One option would be to not use the directory name in the guard, but
instead always use the same prefix, like "GDB". This might imply adding
a check to ensure that there aren't any clashes.
Let me know what you think.
Tom
More information about the Gdb-patches
mailing list