[lld] r230422 - Suppress 'warning C4062: enumerator X in switch of enum Y is not handled' from system header.

Michael Spencer bigcheesegs at gmail.com
Tue Feb 24 18:47:41 PST 2015


On Tue, Feb 24, 2015 at 6:12 PM, Aaron Ballman <aaron at aaronballman.com> wrote:
> On Tue, Feb 24, 2015 at 8:30 PM, Michael J. Spencer
> <bigcheesegs at gmail.com> wrote:
>> Author: mspencer
>> Date: Tue Feb 24 19:30:13 2015
>> New Revision: 230422
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=230422&view=rev
>> Log:
>> Suppress 'warning C4062: enumerator X in switch of enum Y is not handled' from system header.
>>
>> Modified:
>>     lld/trunk/CMakeLists.txt
>>
>> Modified: lld/trunk/CMakeLists.txt
>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/CMakeLists.txt?rev=230422&r1=230421&r2=230422&view=diff
>> ==============================================================================
>> --- lld/trunk/CMakeLists.txt (original)
>> +++ lld/trunk/CMakeLists.txt Tue Feb 24 19:30:13 2015
>> @@ -88,6 +88,7 @@ endif()
>>
>>  if (MSVC)
>>    add_definitions(-wd4530) # Suppress 'warning C4530: C++ exception handler used, but unwind semantics are not enabled.'
>> +  add_definitions(-wd4062) # Suppress 'warning C4062: enumerator X in switch of enum Y is not handled' from system header.
>>  endif()
>>
>>  include_directories(BEFORE
>
> I think it would be better to limit this to just the file causing the
> warning instead of for all files in lld. I've narrowed (and reported
> to Microsoft) the issue down to being lld/Core/Parallel.h where it
> includes concrt.h and ppl.h for MSCV builds. Since it's already in an
> _MSC_VER block, we could use MSVC's #pragma warning to disable it
> without introducing any new conditional compilation, either.
>
> ~Aaron

I suppose that's fine. I felt it wasn't worth the effort at the time
as clang has much better warnings for this case.

- Michael Spencer



More information about the llvm-commits mailing list