Skip to content

Commit bd0eecc

Browse files
authored
Handle long file paths on Windows
Comment suggestion
1 parent 80f0648 commit bd0eecc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang-tools-extra/test/clang-tidy/check_clang_tidy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ def __init__(self, args: argparse.Namespace, extra_args: List[str]) -> None:
146146
self.clang_extra_args.append("-resource-dir=%s" % self.resource_dir)
147147

148148
def read_input(self) -> None:
149+
# Use a "\\?\" prefix on Windows to handle long file paths transparently:
150+
# https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation
149151
file_name = self.input_file_name
150152
if platform.system() == "Windows":
151153
file_name = "\\\\?\\" + os.path.abspath(file_name)

0 commit comments

Comments
 (0)