[PATCH] D87962: [clang] Change the multi-character character constants from extension to implementation-defined.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 28 06:21:50 PDT 2020


aaron.ballman added a comment.

Multichar literals are implementation-defined in C and conditionally supported with implementation-defined semantics in C++. I agree that it may make sense to warn about their use for portability reasons, but I'm not certain whether it makes sense to promote their use to be always-on diagnostics. I'm curious to know if this change causes any issues with system headers (which may or may not still define four char codes) or popular libraries.

I was curious as to why this was an extension in the first place and found the original commits (https://github.com/llvm/llvm-project/commit/74c95e20af4838152a63010292d1063835176711 and https://github.com/llvm/llvm-project/commit/8577f62622d50183c7413d7507ec783d3c1486fc) but there's no justification as to why this was picked as an extension.



================
Comment at: clang/include/clang/Basic/DiagnosticLexKinds.td:109
   "multi-character character constant">, InGroup<MultiChar>;
-def ext_four_char_character_literal : Extension<
+def ext_four_char_character_literal : Warning<
   "multi-character character constant">, InGroup<FourByteMultiChar>;
----------------
One potential reason why we don't want to warn on this by default is that four char codes were quite popular back in the Mac Classic days.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87962



More information about the cfe-commits mailing list