Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
7781 Discussions

Error in Intel C++ compiler 16.0 in enumeration checking

mikhail_k_4
Beginner
311 Views

I have a piece of code that successfully compiled by Xcode native complete in c++14 mode. The attempt to compile it with icc with -std=c++14 give the following error:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Security.framework/Headers/CSCommon.h(203): error: enumeration value is outside the range of its underlying type ("unsigned int")

      kSecCSConsiderExpiration = 1 << 31,        /* consider expired certificates invalid */

Is it normal? 1<< 31 is 0x80000000 and it a prefect unsigned int value.

0 Kudos
7 Replies
TimP
Black Belt
311 Views

Did you mean to type 1U << 31 ?

It's unusual but not unheard of for icc to exhibit more thorough checking than clang or gcc.

mikhail_k_4
Beginner
311 Views

I have show you line from the Apple framework header, so I don`t know what the means there. What the way of solving this problem? I can`t correct standard headers... In any way 1 << 31 is inside int and unsigned int, why does icc get error here?

Kittur_G_Intel
Employee
311 Views

HI Mikhail,
Can you attach a test reproducer (preferably a preprocessed file compiled with -P option that generates the .i file) so I can investigate the issue?
Thanks,
Kittur

mikhail_k_4
Beginner
311 Views

Hi Kittur Ganesh,

As you requested .cpp and .i files is in attachment. One remark: I try to use icc version 16.0.1 20151020, because 16.0.2 20160204 could not compile std::function<> template at all. In update2 there is no problem with the enum itself.

Maybe you know when to expect update 3 of icc version 16?

Mikhail.

Kittur_G_Intel
Employee
311 Views

Hi Mikhail,
I couldn't reproduce the issue with your attachment. Also, the cpp file only has the include line and main function which is empty. Unless I can reproduce the issue I can't file with the developers :-(

Good to know you don't have any issue with update 2 on the enum itself.  Well, the update 3 should be released as well soon but I don't have the correct schedule with me. I'll keep you updated as soon as the release is out?
Thanks,
Kittur

Kittur_G_Intel
Employee
311 Views

Hi Mikhail,
Yes, I could reproduce the issue and have filed with the developers. I'll let you know as soon as the release with the fix is out. Appreciate your patience till then.
Regards,
Kittur

Kittur_G_Intel
Employee
311 Views

BTW, the workaround is to not use C++11 for now until the release with the fix is out, appreciate much.

Kittur

Reply