This is an archive of the discontinued LLVM Phabricator instance.

[flang][msvc] Do not use gcc/clang command line options for msvc.
ClosedPublic

Authored by Meinersbur on Aug 5 2020, 1:24 PM.

Details

Summary

The command line options -Wno-error and -Wno-unused-parameter are specific to gcc/clang, do not use them when compiling with other compilers.

This patch is part of the series to make flang compilable with MS Visual Studio.

Diff Detail

Event Timeline

Meinersbur created this revision.Aug 5 2020, 1:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2020, 1:24 PM
Meinersbur requested review of this revision.Aug 5 2020, 1:24 PM

What's the reason for keeping these? IMO, the lines should be removed and let FLANG_ENABLE_WERROR cmake option add it if a developer needs it.

Some developers build with -Werror and removing them entirely would break their build since these components seem to have warnings in them. There were lengthy discussions about the point of -Werror already (see D78306, D81695), which this patch is not about, just making it msvc-compatible.

isuruf accepted this revision.Aug 6 2020, 8:50 AM
This revision is now accepted and ready to land.Aug 6 2020, 8:50 AM

Some developers build with -Werror and removing them entirely would break their build since these components seem to have warnings in them. There were lengthy discussions about the point of -Werror already (see D78306, D81695), which this patch is not about, just making it msvc-compatible.

We always built with -Werror before we contributed f18 to llvm, and still do so in-house for the discipline it enforces, but gcc's warning about unused function arguments produced false messages in the case of templatized code (esp. with constexpr) that are not practical to work around, so that warning is explicitly disabled.

Some developers build with -Werror and removing them entirely would break their build since these components seem to have warnings in them. There were lengthy discussions about the point of -Werror already (see D78306, D81695), which this patch is not about, just making it msvc-compatible.

We always built with -Werror before we contributed f18 to llvm, and still do so in-house for the discipline it enforces, but gcc's warning about unused function arguments produced false messages in the case of templatized code (esp. with constexpr) that are not practical to work around, so that warning is explicitly disabled.

I removed the setting of CMAKE_CXX_FLAGS and couldn't find a version of GCC that failed. Can we just get rid of this? @schweitz?

I've created https://reviews.llvm.org/D85465 to remove these options completely.