[PATCH] D78306: [flang] Use LLVM's flags

Isuru Fernando via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 21:38:22 PDT 2020


isuruf added inline comments.


================
Comment at: flang/CMakeLists.txt:239
-# Add global F18 flags.
-set(CMAKE_CXX_FLAGS "-fno-rtti -fno-exceptions -pedantic -Wall -Wextra -Werror -Wcast-qual -Wimplicit-fallthrough -Wdelete-non-virtual-dtor ${CMAKE_CXX_FLAGS}")
-
----------------
tskeith wrote:
> isuruf wrote:
> > tskeith wrote:
> > > isuruf wrote:
> > > > tskeith wrote:
> > > > > `-pedantic` should still be included in the compilation options.
> > > > There's an option `LLVM_ENABLE_PEDANTIC` which is enabled by default.
> > > When I do an out-of-tree build of flang, this is a compilation command that I'm seeing:
> > > ```
> > > clang++ -DGTEST_HAS_RTTI=0 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I../../include -Iinclude -isystem $LLVM/mlir/include -isystem $LLVM/build/Release-clang-9/tools/mlir/include -isystem $LLVM/llvm/include -isystem $LLVM/build/Release-clang-9/include -fPIC -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -Wno-string-conversion -Wno-unused-command-line-argument -Wstring-conversion -Wcovered-switch-default -Wno-nested-anon-types -O2 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-exceptions -fno-rtti -std=c++17 -MD -MT lib/Common/CMakeFiles/obj.FortranCommon.dir/Fortran.cpp.o -MF lib/Common/CMakeFiles/obj.FortranCommon.dir/Fortran.cpp.o.d -o lib/Common/CMakeFiles/obj.FortranCommon.dir/Fortran.cpp.o -c ../../lib/Common/Fortran.cpp
> > > ```
> > > There is no `-pedantic` there.
> > Can you check now?
> Yes, it's there now. So is `-Wno-long-long`. Is that intended?
I don't think `-Wlong-long` is enabled in C++11 or above with `-pedantic`. So, that's harmless.

>From gcc docs,

>    Warn if long long type is used. This is enabled by either -Wpedantic or -Wtraditional in ISO C90 and C++98 modes. To inhibit the warning messages, use -Wno-long-long.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78306





More information about the llvm-commits mailing list