[libc-commits] [libc] [libc] fix clang-tidy llvm-header-guard warnings (PR #82679)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Tue Feb 27 16:00:00 PST 2024


nickdesaulniers wrote:

> Is there a reason you used perl-as-sed rather than clang-tidy --fix?

It is one command line vs many different command line invocations. ;)

> I think that would fully canonicalize things wrt the trailing underscores too.

Sure, I'll give it a shot!

> It seems like all of these are public headers in include.
> I think we had those extra underscores for macro namespacing purposes.

Can you clarify what you mean by that?

> I'm not sure if we actually want to remove those, it might be better to remove the check from the include folder.
> Or modify the clang tidy so it handles the include folder in a special way?

Perhaps, if we have a justification why we need different conventions for different directories.  I highly suspect we don't actually need them and may be cargo culting historical accidents forward.

I could replace all these lines with `#pragma once` to further demonstrate the lack of a need for a convention based on directory (and remind users that we only support modern open source compilers from the last decade).

When in doubt, I guess I'd be curious if libcxx has such a convention between "user visible" vs "internal only" header guards?

https://github.com/llvm/llvm-project/pull/82679


More information about the libc-commits mailing list