Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
The Intel sign-in experience is changing in February to support enhanced security controls. If you sign in, click here for more information.
7749 Discussions

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

pmor
Beginner
424 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
403 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.


VidyalathaB_Intel
Moderator
360 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.

 

VidyalathaB_Intel
Moderator
327 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.h...


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.


VidyalathaB_Intel
Moderator
264 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.


Reply