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

C compiler: missing diagnostics "conditional expression where only one operand have void type is fo"

pmor
Beginner
669 Views

Sample code (t0.c):

void* f(void)
{
        1 ? f() : (void)f();
        return 0;
}

Invocation:

icc t0.c -std=c11 -pedantic -Wall -Wextra

Expected diagnostics:

conditional expression where only one operand have void type is forbidden

Actual diagnostics:

<nothing>

Version:

icc 2021.5.0 on x86-64 on Linux
0 Kudos
5 Replies
DitiD_Intel
Moderator
650 Views

Hi,


Thank you for posting in Intel Communities.


The issue raised by you is reproducible from our end with icc compiler (thanks for bringing this to our notice) whereas the icx compiler is working as expected by throwing a warning. We are working on this issue internally, we will get back to you soon.


Thanks & Regards,

Ditipriya.


0 Kudos
DitiD_Intel
Moderator
618 Views

Hi,

 

We have reported this issue to the concerned development team. They are looking into your issue.

 

Thanks & Regards,

Ditipriya.

 

0 Kudos
DitiD_Intel
Moderator
579 Views

Hi,

 

Thank you for your patience.

 

Not sure if you are aware of it, but the C++ Classic compiler will enter "Legacy Product Support" mode signaling the end of regular updates. Please see the below article for more details.

https://www.intel.com/content/www/us/en/developer/articles/technical/adoption-of-llvm-complete-icx.html

 

So we suggest you try with icx compiler (2022.0.0) as it is working as expected by throwing a warning from our end.

 

Thanks & Regards,

Ditipriya.

 

0 Kudos
pmor
Beginner
567 Views

@DitiD_Intel Thanks for the link. One question: how exactly Intel's LLVM-based X86 backend is different from LLVM's X86 backend? Where is to read about that?

0 Kudos
DitiD_Intel
Moderator
484 Views

Hi,

 

Thank you for your patience.

 

Intel LLVM compilers are expected to give higher performance than the base clang+LLVM for Intel architecture. The default for the Intel C/C++ compilers going forward are versions (icx) that have adopted the LLVM open source infrastructure.

 

ICX is Intel nextgen compiler based on Clang /LLVM technology plus Intel proprietary optimizations and code generation.

 

The latest Intel C/C++ compilers, using LLVM, deliver faster compiler times, better optimizations, enhanced standards support, and support for GPU and FPGA offloading.

 

Please refer to the link mentioned below for more information.

 

https://www.intel.com/content/www/us/en/developer/articles/technical/adoption-of-llvm-complete-icx.html

 

The version against which you reported your issue is no longer targeted for fixes. Please check out the new versions of Intel oneAPI Toolkits for the latest features.

 

Thanks and Regards,

Ditipriya.

 

0 Kudos
Reply