[PATCH] D19843: Use the name of the file on disk to issue a new diagnostic about non-portable #include and #import paths.

Eric Niebler via cfe-commits cfe-commits at lists.llvm.org
Fri May 27 15:09:08 PDT 2016


eric_niebler added a comment.

Awesome, thanks.


================
Comment at: include/clang/Basic/DiagnosticLexKinds.td:278
@@ +277,3 @@
+def pp_nonportable_path : Warning<
+  "non-portable path '%0' found in preprocessor directive">,
+  InGroup<NonportableIncludePath>;
----------------
rsmith wrote:
> The fix-it hints aren't shown in some modes of operation; it might be helpful for this diagnostic to be a bit more explicit about what's non-portable since without the fixit it's not obvious. Maybe something like
> 
>     "non-portable path to file '%0'; specified path differs in case from file name on disk"
> 
> where %0 is the corrected path?
Good suggestion.

================
Comment at: lib/Lex/PPDirectives.cpp:1763-1765
@@ +1762,5 @@
+  // than the one we're about to open.
+  //
+  // Because testing for non-portable paths is expensive, only do it if the
+  // warning is not currently ignored.
+  const bool CheckIncludePathPortability =
----------------
rsmith wrote:
> Looks like this comment is stale?
Oops, yeah.


http://reviews.llvm.org/D19843





More information about the cfe-commits mailing list