Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

swscanf_s + /Qip Incorrect compilation results

Underground78
Beginner
370 Views

Hello,

We have some issues with the the Intel C++ compiler (version 13.1.0.149 Build 20130118) that seem related to the swscanf_s function and the /Qip option. Depending of the code used, either the program crashes completely or gives incorrect results when /Qip is used.

I have simplified the code and the command line used a lot (the code is originally from Media Player Classic HomeCinema) to make reproducing the issue easy. The test.cpp file is the simplest example I could come up with, it can be compiled with icl /Qip /o test.exe test.cpp to reproduce the issue.

If you need any other information let me know!

Regards,
Underground78

0 Kudos
4 Replies
JenniferJ
Moderator
370 Views

Thank you very much for reporting this issue with a small testcase. I can duplicate the problem and will submit a bug report to the compiler team.

C:\test>icl /O1 /Qip test.cpp
C:\test>test
5025678

C:\test>icl /O2 /Qip test.cpp
C:\test>test
C:\test>

There are several workarounds: /O1 or /O2 /Ob2.
Jennifer

0 Kudos
iccuser
Beginner
370 Views

This wasn't fixed in update 3?

0 Kudos
SergeyKostrov
Valued Contributor II
370 Views
>>This wasn't fixed in update 3? I don't know and I've put a hold on Update 3 ( sorry, too many issues and problems ). I did a verification with a legacy C++ compiler and here are results: ..\Test>bcc32.exe Main.cpp Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland Main.cpp: Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland Main.cpp - 0 error(s), 0 warning(s) ..\Test>Main.exe 5025678 Also, a test application compiled with Intel(R) C++ Compiler XE for applications running on IA-32, Version 12.1.7.371 Build 20120928 fails as well.
0 Kudos
JenniferJ
Moderator
370 Views

Update to this issue. it is fixed in update 5.

you can download the update 5 from the Intel Registration Center.

Jennifer

0 Kudos
Reply