[PATCH] D93999: [clang] Fix message text for `-Wpointer-sign` to account for plain char

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 8 11:38:41 PST 2021


aaron.ballman added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:7783-7784
   "|%diff{casting $ to type $|casting between types}0,1}2"
-  " converts between pointers to integer types with different sign">,
+  " converts between pointers to integer types that differ by"
+  " signed/unsigned/plain variation">,
   InGroup<DiagGroup<"pointer-sign">>;
----------------
hubert.reinterpretcast wrote:
> aaron.ballman wrote:
> > I fee like `that differ by signed/unsigned/plain variation` is a bit hard for users to understand and maybe we want to spell it out a bit more explicitly. I took a stab at a more wordy diagnostic that I think is easier to understand, but if you have other ideas, I'm not tied to my wording. WDYT?
> > 
> > (Same suggestion applies below -- though we may want to switch to `ext_typecheck_convert_incompatible_pointer_sign.Text` below rather than spelling all this out manually.)
> I think the "other excludes sign information" wording makes this sound like a portability diagnostic. I was going for wording that retains the same "seriousness" for the plain char versus signed/unsigned char case as for the signed char versus unsigned char case.
> 
> Would "where one is of the unique plain char type and the other is not" work?
> Would "where one is of the unique plain char type and the other is not" work?

Yeah, I think that's great wording, thank you!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93999/new/

https://reviews.llvm.org/D93999



More information about the cfe-commits mailing list