[PATCH] D85722: [SystemZ][z/OS] enable trigraphs by default on z/OS

Abhina Sree via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 13 07:07:31 PDT 2020


abhina.sreeskantharajan marked 3 inline comments as done.
abhina.sreeskantharajan added inline comments.


================
Comment at: clang/lib/Frontend/CompilerInvocation.cpp:2791
+  Opts.Trigraphs =
+      (!Opts.GNUMode && !Opts.MSVCCompat && !Opts.CPlusPlus17) || T.isOSzOS();
   Opts.Trigraphs =
----------------
hubert.reinterpretcast wrote:
> I would like to point out that processing trigraphs when most platforms don't would be a portability concern. Clang appears to mitigate this somewhat with warnings.
Unfortunately we can't move away from this because the system headers currently use trigraphs. But we will definitely look into whether we can update these headers to not be dependent on trigraphs and improve portability.


================
Comment at: clang/test/Frontend/trigraphs.cpp:8
+// RUN: %clang_cc1 -DZOS -triple=s390x-none-zos -verify -fsyntax-only %s
+// RUN: %clang_cc1 -DZOSNOTRI -triple=s390x-none-zos -fno-trigraphs -verify -fsyntax-only %s
 
----------------
hubert.reinterpretcast wrote:
> Do we know if `-fno-trigraphs` is meaningfully functional on z/OS? I believe trigraph usage might need to be replaced to use digraphs in the system headers before using `-fno-trigraphs` can be expected to work in a real user application.
With the current system headers, compiling with -fno-trigraphs would not work in a user application. As mentioned above, we will look into whether we can remove this dependency.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85722



More information about the cfe-commits mailing list