Repository navigation
Clang-cl: Fix #739 compatibility macros & add to AppVeyor - #741
Closed
Farwaykorse wants to merge 86 commits into
Closed
Farwaykorse wants to merge 86 commits into
Farwaykorse wants to merge 86 commits into
Conversation
|
Farwaykorse thanks for the fix, can we also add test cases in appveyor.yml to make this always true? |
Contributor
Author
|
Compiling with clang-cl in Appveyor seems possible, but I don't have any experience with this. |
Farwaykorse
force-pushed
the
clang-cl_2
branch
from
November 13, 2018 18:20
3deac31 to
7347fc5
Compare
Contributor
Author
|
I've made an error while reordering the options. |
Farwaykorse
added a commit
to Farwaykorse/GSL
that referenced
this pull request
Nov 13, 2018
Temporarily disable msvc compilation for faster testing (microsoft#741)
Temporarily disable msvc compilation for faster testing (microsoft#741)
Farwaykorse
force-pushed
the
clang-cl_2
branch
from
November 13, 2018 21:24
d280c16 to
1a15d74
Compare
Contributor
Author
|
Issue with lld-link and the vcpkg install: |
Farwaykorse
added a commit
to Farwaykorse/GSL
that referenced
this pull request
Nov 14, 2018
Farwaykorse
force-pushed
the
clang-cl_2
branch
from
November 14, 2018 18:55
301b41c to
84f5794
Compare
Farwaykorse
added a commit
to Farwaykorse/GSL
that referenced
this pull request
Nov 14, 2018
Farwaykorse
force-pushed
the
clang-cl_2
branch
from
November 14, 2018 21:44
0422f5e to
f810ce7
Compare
Since CMake v3.0 use of Clang for both is deprecated
Contributor
Author
|
Changes:
|
This reverts commit 2238c47.
Anna Gringauze (annagrin)
approved these changes
Jan 15, 2019
|
Farwaykorse I will resolve conflicts caused by my changes. Thanks Farwaykorse! |
|
added PR #762 to resolve conflicts |
Contributor
Author
|
Thanks Anna Gringauze (@annagrin) and Casey Carter (@CaseyCarter) for your friendly and constructive feedback. |
Anna Gringauze (annagrin)
pushed a commit
that referenced
this pull request
Jan 15, 2019
* Added c++17 test configurations for clang5.0 and clang6.0 * Fix #739 correct cppcorecheck warnings for clang-cl * Add clang-cl configurations * Corrections Appveyor; Temporarily disable msvc compilation for faster testing (#741) * Add path to clang-cl.exe (#741) * Escape backslash in path (#741) * Update vcpkg (#741) * Check vcpkg version; try without building vcpkg; use latest clang-cl from path (#741) * Fix blocks in ps script (#741) * Try accessing APPVEYOR_BUILD_FOLDER variable (#471) * Update span size() bug confirmation test for GCC 6.5 (#741) * MSVC flags to Clang-cl; disable c++98-compat and undefined macro warnings (#741) * Suppress clang warning on tests (missing-prototypes) (#741) * Fix clang warning -Wnewline-eof (#741) * Fix clang warning -Wdouble-promotion (#741) * Set linker explicitly * Clean condition statement * For Clang, fallback to the AppVeyor installed version of CMake * Fix clang warning -Wmissing-variable-declarations * Fallback to the MSVC linker until vcpkg has been updated * Revert "Fallback to the MSVC linker until vcpkg has been updated" This reverts commit 7263f32. * Fix clang warning -Wunused-member-function * Fix clang warning -Wmissing-noreturn * Fix clang warning -Winvalid-noreturn on Windows * Add macro block end comment on large #if blocks * Workaround: fallback to mscv link.exe * Workaround: get msvc paths into PowerShell through intermediate file * Workaround: fix, remove "PATH=" from text * Workaround: try with full-path; and return user PATH * Workaround: fix, escape backslashes * Revert all since "Workaround: fallback to mscv link.exe" did not work on AppVeyor This reverts the commits: bda3d6a 9706293 0f4fb04 1b0c19a a5739ea * Suppress output of git pull; remove vcpkg from cache * Re-enable AppVeyor builds for all platforms * Correct typo Co-Authored-By: Farwaykorse <[email protected]> * Add Clang-cl 7.0.0 to the supported platforms * Revert "Fix clang warning -Wunused-member-function" This reverts commit 6fe1a42. * Fix or locally suppress clang warning -Wunused-member-function * format touched code and correct comment * git pull --quiet * fix logic error in workaround * fix missing bracket * Suppress output of mkdir * Replace MSBuild with Ninja * Suppress output of 7z * Add architecture flags for Clang * Drop workaround for lld-link * 7-zip Overwrite and Alternative output suppression without suppressing errors Replaces 3c1c079 * AppVeyor setup and CMake before build * reorder compiler configuration * remove unnecessary * remove -fno-strict-aliasing * remove -Wsign-conversion, since before v4.0 part of -Wconversion * -Wctor-dtor-privacy is GCC only * remove -Woverloaded-virtual part of -Wmost, part of -Wall * add -Wmissing-noreturn * remove the pragmas for -Wunused-member-function * Re-add MSBuild generator on AppVeyor * Print CMake commands * Add MSBuild toolset selection * Separate Architecture setting * clang-cl: add -Weverything * clang-cl -Wno-c++98-compat * clang-cl -Wno-c++98-compat-pedantic * clang-cl -Wno-missing-prototypes * clang-cl C++14 -Wno-unused-member-function * clang-cl -Wundef __GNUC__ * clang++: add -Weverything * clang++ -Wno-c++98-compat * clang++ -Wno-c++98-compat-pedantic * clang++ -Wno-missing-prototypes * clang++ -Wno-weak-vtables * clang++ C++14 -Wno-unused-member-function * clang++ fix -Wundef _MSC_VER * clang++ -Wno-padded * clang++ solve -Wdeprecated * Add AppleClang compiler target Since CMake v3.0 use of Clang for both is deprecated * clang++ v5.0 C++17 -Wno-undefined-func-template * Add VS2015 + LLVM/clang-cl to AppVeyor * Do not disable constexpr when compiling with clang-cl on Windows * Clean-up clang-only warnings (now under -Weverything) * Revert "Fix clang warning -Winvalid-noreturn on Windows" This reverts commit 2238c47. * Suppress -Winvalid-noreturn for the MS STL noexception workaround * CMake: put preprocessor definition in target_compile_definitions * Solve compiler warning C4668: __GNUC__ not defined
PARK DongHa (luncliff)
added a commit
to luncliff/coroutine
that referenced
this pull request
Jan 16, 2019
* Changed GSL to reference master branch * microsoft/GSL#741 * TravisCI windows build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As described in #739.
When building on Windows with clang-cl.exe (the compatible replacement for cl.exe), both the macros
_MSC_VERand__clang__are defined.To get the temporary compatibility fix (#703) working with clang-cl, the check for
__clang__has to come first.Adding compilation tests with AppVeyor:
Build 26: on Linux
COMPILER=g++-6 BUILD_TYPE=Release GSL_CXX_STANDARD=14Resolves [Travis CI] Test broken size fails with GCC 6.5 #745
Using the VS 2017 and the LLVM toolset integration (vs extension available on AppVeyor). This tests the use of clang-cl from VS projects.
Temporary fix for the lld-linker and vcpkg (version installed on AppVeyor)--> No issue with Ninja(link using link.exe or update the installed vcpkg version)Replace thegit pullof vcpkg with a fallback to the msvc linkerWorks locally but can't get it working on AppVeyor.
Therefore sticking with pulling vcpkg.--> NinjaThe--> Ninjagit pullcommand on AppVeyor appears to generate a 'remote exception' bce6ed2-fno-exceptionsis not recognised by clang-cl'; results in:-Wunknown-argument100f2b9-std=c++1z; ...clang-cl.exe : error : unknown argument ignored in clang-cl: '-std=c++1z' [-Werror,-Wunknown-argument]Fix: When building with clang-cl use the version of CMake installed on AppVeyor (v3.12.2) . 9a625ab
Is there a reason for using CMake v3.8.0? Yes: Issue CMake version #487 discusses the use of older CMake versions to ensure accessibility.
-Winvalid-noreturn2238c47 Enabled by Defaultgsl\include\gsl/gsl_assert(123): error : function declared 'noreturn' should not return [-Werror,-Winvalid-noreturn]-Wnewline-eof137367b -Weverythinggsl\tests\multi_span_tests.cpp(1785): error : no newline at end of file [-Werror,-Wnewline-eof]-Wunused-member-function337a03c -Weverythinggsl\tests\span_tests.cpp(57): error : unused member function 'operator&' [-Werror,-Wunused-member-function]-Wdouble-promotionf810ce7 -Weverythinggsl\tests\notnull_tests.cpp(196): error : implicit conversion increases floating-point precision: 'float' to 'double' [-Werror,-Wdouble-promotion]-Wmissing-noreturn1b15a73 -Weverythinggsl\tests\no_exception_ensure_tests.cpp(29): error : function 'test_terminate' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]gsl\tests\no_exception_throw_tests.cpp(28): error : function 'test_terminate' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]-Wmissing-variable-declarations329da83 -Weverythinggsl\tests\utils_tests.cpp(83): error : no previous extern declaration for non-static variable 'j' [-Werror,-Wmissing-variable-declarations]Extra:
Replace MSBuild withAdd Ninja-build. AppVeyor execution time reduction with 60%.Cmake issue: Ninja generator fails with clang-cl when mixing 64/32 bit clang and Visual Studio Environment
Improvements: (After review by annagrin)
+ 'flatter' decision structure; - some duplication; + more specific to each compiler
Note:
/W4enables-Walland-Wextra. 2bdb8f9 767f34c 595a726-fno-strict-aliasingno issues building without it. b1e63fd-Wunused-member-functionfromspan_tests.cppto configuration.note: With
-Weverythingadd:$<$<EQUAL:${GSL_CXX_STANDARD},14>:-Wno-unused-member-function>c98c546-Wno-*flags? - Local issue.Remove flags. 7b85156- pushed warning level.Find first working CMake version.Proper flags for clang-cl. v7.0.0 does not recognize-std=c++1z.Both CMake and clang on AppVeyor are updated regularly. Unless both can be pinned, similar issues will appear again. Besides, this exercises the usage of the latest CMake release.
-Weverything9ef9808-Wc++98-compatand-Wc++98-compat-pedantic57ac640, bef30b8-Wmissing-prototypesin tests f96eca3-Wundefon macro__GNUC__a987075-Weverything-Wweak-vtables- suppressed fcbbe1f-Wundefon macro_MSC_VEReb60986-Wpaddedin gsl_util:51 and multi_span:1231 - suppressed fe882ce-Wundefined-func-templateonly in clang v5.0.2. e7812cb-Wdeprecatedsolved e7812cb-Wkeyword-macroClang does not require theconstexprdisabling macro. f40a69eResolves #739