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

C compiler: missing diagnostics: taking the address of an expression of type 'void'

pmor
Beginner
667 Views

Per C11 this code is invalid:

extern void x;
void* p = &x;

Intel C compiler does not diagnose it:

$ icc t0.c -std=c11 -Wall -Wextra -pedantic -c
<nothing>

Version: icc 2021.1.2 on x86-64 on Linux

0 Kudos
4 Replies
VidyalathaB_Intel
Moderator
646 Views

Hi Pavel,


Thanks for reaching out to us.


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.


Regards,

Vidya.


0 Kudos
VidyalathaB_Intel
Moderator
603 Views

Hi Pavel,

 

We have reported this issue to the concerned development team. They are looking into your issue and will get back to you soon.

 

Regards,

Vidya.

 

0 Kudos
VidyalathaB_Intel
Moderator
570 Views

Hi Pavel,


Not sure if you are aware of, but 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 generating a warning as expected when we checked it from our end.


Regards,

Vidya.


0 Kudos
VidyalathaB_Intel
Moderator
507 Views

Hi Pavel,


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.


We are going ahead and closing this thread (as icx compiler is working as expected).

Please raise a new thread if you need any additional information from Intel as this thread will no longer be monitored.


Regards,

Vidya.


0 Kudos
Reply