Skip to content

Fix documentation warnings building runtime with clang-cl #6238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2017
Merged

Fix documentation warnings building runtime with clang-cl #6238

merged 1 commit into from
Jan 9, 2017

Conversation

hughbe
Copy link
Contributor

@hughbe hughbe commented Dec 12, 2016

ICU uses some forms of deprecated documentation. This causes several hundred warnings building the runtime with clang-cl.
We don't care though, because ICU is external.

@compnerd
Copy link
Member

This shouldnt be needed. The recent change to the inclusion should silence those, if not, that is a cmake issue that we should report. At that point, we can just push the -Wno-documentation in the build system.

@hughbe
Copy link
Contributor Author

hughbe commented Dec 13, 2016

I'll test with an updated branch and respond as appropriate

@hughbe
Copy link
Contributor Author

hughbe commented Dec 13, 2016

Can't reproduce. Closing. Thanks

@hughbe hughbe closed this Dec 13, 2016
@hughbe hughbe deleted the stubs-clang-cl branch December 13, 2016 16:30
@hughbe hughbe restored the stubs-clang-cl branch December 16, 2016 15:37
@hughbe
Copy link
Contributor Author

hughbe commented Dec 16, 2016

log.txt

I can reproduce this - I assume I was building with MSVC instead of clang accidently. Take a look at the log above. I'm going to reopen this issue

@hughbe hughbe reopened this Dec 16, 2016
@compnerd
Copy link
Member

Can you get the actual compiler invocation? I suspect that we arent passing -isystem for the inclusion.

@hughbe
Copy link
Contributor Author

hughbe commented Dec 19, 2016

This is an extract from the ninja build file - seems like ICU is passed as "-I". I think the problem is that clang-cl doesn't expose "-isystem", so its just included normally

build stdlib\public\runtime\CMakeFiles\swiftRuntime-windows-x86_64.dir\AnyHashableSupport.cpp.obj: CXX_COMPILER__swiftRuntime-windows-x86_64 C$:\Users\hbellamy\Documents\GitHub\my-swift\swift\stdlib\public\runtime\AnyHashableSupport.cpp
  DEFINES = -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_DEBUG_POINTER_IMPL="" -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
  FLAGS = /DWIN32 /D_WINDOWS   /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /Brepro /Zc:sizedDealloc- -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -fno-sanitize=all /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1    /EHs-c- /GR- -Wglobal-constructors -Wexit-time-destructors -DSWIFT_RUNTIME_CLOBBER_FREED_OBJECTS=1 -D__SWIFT_CURRENT_DYLIB=swiftCore -DswiftCore_EXPORTS -DLLVM_ON_WIN32 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_USE_WINAPI_FAMILY_DESKTOP_APP -D_DLL -fms-compatibility-version=1900 /Od -Xclang --dependent-lib=oldnames -D_MDd -Xclang --dependent-lib=msvcrtd -UNDEBUG
  INCLUDES = -Istdlib\public\runtime -IC:\Users\hbellamy\Documents\GitHub\my-swift\swift\stdlib\public\runtime -IC:\Users\hbellamy\Documents\GitHub\my-swift\swift\include -Iinclude -IC:\Users\hbellamy\Documents\GitHub\my-swift\llvm\include -IC:\Users\hbellamy\Documents\GitHub\my-swift\build\Ninja-DebugAssert\llvm-windows-amd64\include -IC:\Users\hbellamy\Documents\GitHub\my-swift\build\Ninja-DebugAssert\llvm-windows-amd64\tools\clang\include -IC:\Users\hbellamy\Documents\GitHub\my-swift\llvm\tools\clang\include -IC:\Users\hbellamy\Documents\GitHub\my-swift\cmark\src -IC:\Users\hbellamy\Documents\GitHub\my-swift\build\Ninja-DebugAssert\cmark-windows-amd64\src -IC:\Users\hbellamy\Documents\GitHub\my-swift\icu\include
  IN_ABS = C:\Users\hbellamy\Documents\GitHub\my-swift\swift\stdlib\public\runtime\AnyHashableSupport.cpp
  OBJECT_DIR = stdlib\public\runtime\CMakeFiles\swiftRuntime-windows-x86_64.dir
  OBJECT_FILE_DIR = stdlib\public\runtime\CMakeFiles\swiftRuntime-windows-x86_64.dir
  TARGET_COMPILE_PDB = stdlib\public\runtime\CMakeFiles\swiftRuntime-windows-x86_64.dir\
  TARGET_PDB = ""
build stdlib\public\runtime\CMakeFiles\swiftRuntime-windows-x86_64.dir\Casting.cpp.obj: CXX_COMPILER__swiftRuntime-windows-x86_64 C$:\Users\hbellamy\Documents\GitHub\my-swift\swift\stdlib\public\runtime\Casting.cpp
  DEFINES = -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_DEBUG_POINTER_IMPL="" -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
  FLAGS = /DWIN32 /D_WINDOWS   /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /Brepro /Zc:sizedDealloc- -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -fno-sanitize=all /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1    /EHs-c- /GR- -Wglobal-constructors -Wexit-time-destructors -DSWIFT_RUNTIME_CLOBBER_FREED_OBJECTS=1 -D__SWIFT_CURRENT_DYLIB=swiftCore -DswiftCore_EXPORTS -DLLVM_ON_WIN32 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_USE_WINAPI_FAMILY_DESKTOP_APP -D_DLL -fms-compatibility-version=1900 /Od -Xclang --dependent-lib=oldnames -D_MDd -Xclang --dependent-lib=msvcrtd -UNDEBUG
  INCLUDES = -Istdlib\public\runtime -IC:\Users\hbellamy\Documents\GitHub\my-swift\swift\stdlib\public\runtime -IC:\Users\hbellamy\Documents\GitHub\my-swift\swift\include -Iinclude -IC:\Users\hbellamy\Documents\GitHub\my-swift\llvm\include -IC:\Users\hbellamy\Documents\GitHub\my-swift\build\Ninja-DebugAssert\llvm-windows-amd64\include -IC:\Users\hbellamy\Documents\GitHub\my-swift\build\Ninja-DebugAssert\llvm-windows-amd64\tools\clang\include -IC:\Users\hbellamy\Documents\GitHub\my-swift\llvm\tools\clang\include -IC:\Users\hbellamy\Documents\GitHub\my-swift\cmark\src -IC:\Users\hbellamy\Documents\GitHub\my-swift\build\Ninja-DebugAssert\cmark-windows-amd64\src -IC:\Users\hbellamy\Documents\GitHub\my-swift\icu\include
  IN_ABS = C:\Users\hbellamy\Documents\GitHub\my-swift\swift\stdlib\public\runtime\Casting.cpp
  OBJECT_DIR = stdlib\public\runtime\CMakeFiles\swiftRuntime-windows-x86_64.dir
  OBJECT_FILE_DIR = stdlib\public\runtime\CMakeFiles\swiftRuntime-windows-x86_64.dir
  TARGET_COMPILE_PDB = stdlib\public\runtime\CMakeFiles\swiftRuntime-windows-x86_64.dir\
  TARGET_PDB = ""
build stdlib\public\runtime\CMakeFiles\swiftRuntime-windows-x86_64.dir\CygwinPort.cpp.obj: CXX_COMPILER__swiftRuntime-windows-x86_64 C$:\Users\hbellamy\Documents\GitHub\my-swift\swift\stdlib\public\runtime\CygwinPort.cpp
  DEFINES = -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_DEBUG_POINTER_IMPL="" -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
  FLAGS = /DWIN32 /D_WINDOWS   /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /Brepro /Zc:sizedDealloc- -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -fno-sanitize=all /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1    /EHs-c- /GR- -Wglobal-constructors -Wexit-time-destructors -DSWIFT_RUNTIME_CLOBBER_FREED_OBJECTS=1 -D__SWIFT_CURRENT_DYLIB=swiftCore -DswiftCore_EXPORTS -DLLVM_ON_WIN32 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_USE_WINAPI_FAMILY_DESKTOP_APP -D_DLL -fms-compatibility-version=1900 /Od -Xclang --dependent-lib=oldnames -D_MDd -Xclang --dependent-lib=msvcrtd -UNDEBUG
  INCLUDES = -Istdlib\public\runtime -IC:\Users\hbellamy\Documents\GitHub\my-swift\swift\stdlib\public\runtime -IC:\Users\hbellamy\Documents\GitHub\my-swift\swift\include -Iinclude -IC:\Users\hbellamy\Documents\GitHub\my-swift\llvm\include -IC:\Users\hbellamy\Documents\GitHub\my-swift\build\Ninja-DebugAssert\llvm-windows-amd64\include -IC:\Users\hbellamy\Documents\GitHub\my-swift\build\Ninja-DebugAssert\llvm-windows-amd64\tools\clang\include -IC:\Users\hbellamy\Documents\GitHub\my-swift\llvm\tools\clang\include -IC:\Users\hbellamy\Documents\GitHub\my-swift\cmark\src -IC:\Users\hbellamy\Documents\GitHub\my-swift\build\Ninja-DebugAssert\cmark-windows-amd64\src -IC:\Users\hbellamy\Documents\GitHub\my-swift\icu\include
  IN_ABS = C:\Users\hbellamy\Documents\GitHub\my-swift\swift\stdlib\public\runtime\CygwinPort.cpp
  OBJECT_DIR = stdlib\public\runtime\CMakeFiles\swiftRuntime-windows-x86_64.dir
  OBJECT_FILE_DIR = stdlib\public\runtime\CMakeFiles\swiftRuntime-windows-x86_64.dir
  TARGET_COMPILE_PDB = stdlib\public\runtime\CMakeFiles\swiftRuntime-windows-x86_64.dir\
  TARGET_PDB = ""

@compnerd
Copy link
Member

Its definitely missing -isystem. Sounds like a CMake issue to me.

@hughbe
Copy link
Contributor Author

hughbe commented Dec 20, 2016

I'm fairly sure clang-cl/MSVC don't have a -isystem compiler option. For now, I think the best course of action is to disable these warnings using pragmas, basically doing what -isystem would do anyways

@hughbe
Copy link
Contributor Author

hughbe commented Jan 9, 2017

@compnerd could we get this tested and merged - basically, the problem is that clang-cl/MSVC don't expose any method of defining an include as a system header, I think. See: http://stackoverflow.com/questions/2541984/how-to-suppress-warnings-in-external-headers-in-visual-c

This works around the many, many, many warnings!

@slavapestov
Copy link
Contributor

@swift-ci Please smoke test

@slavapestov slavapestov self-assigned this Jan 9, 2017
@slavapestov slavapestov merged commit e0fa2e0 into swiftlang:master Jan 9, 2017
@hughbe hughbe deleted the stubs-clang-cl branch January 9, 2017 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants