- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am working on an application that was previously compiled with Intel C++ Compiler 2025.0.1.28. The application includes the following function, which is intended to return 1 if the input string is empty and 0 otherwise. With version 2025.0.1.28, the function behaved as expected.
int ParserCheckZeroLengthString(char* pStr)
{
// check if this is a zero-length string
if (NULL== pStr || pStr[0]=='\0')
{
return 1;
}
return 0;
}
After upgrading to Intel C++ Compiler 2025.3.0.326, the build completes successfully, but at runtime the function incorrectly returns 0 instead of 1 when the string is empty.
We are suspecting this issue may be related to compiler optimisations.
To address this, we attempted to disable or reduce optimisation using the following CMake flags, but they had no effect: Function continued to return 0 for empty parameter string.
////Disable optimisation
-DCMAKE_CXX_FLAGS_RELEASE="/Od /DNDEBUG"
-DCMAKE_C_FLAGS_RELEASE="/Od /DNDEBUG"
and
////Reduce optimisation level
-DCMAKE_CXX_FLAGS_RELEASE="/O2 /Ob2 /DNDEBUG"
-DCMAKE_C_FLAGS_RELEASE="/O2 /Ob2/DNDEBUG"
Question:
How can we compile the existing code base with Intel C++ Compiler 2025.3.0.326 while preserving the same runtime behaviour as with version 2025.0.1.28?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adding printf("returning 1"); just before 'return 1;' statement in ParserCheckZeroLengthString function, code starts behaving correctly again. How to diagnose or fix this issue.?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page