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

C compiler: missing diagnostics "structure with flexible array member shall not be a member of a st"

pmor
Beginner
529 Views

Sample code (t0.c):

struct { struct { int i; int a[]; } x; } x;

Invocation:

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

Expected diagnostics:

structure with flexible array member shall not be a member of a structure

Actual diagnostics:

<nothing>

Version:

icc 2021.5.0 on x86-64 on Linux

C11, 6.7.2.1 Structure and union specifiers, Constraints, 3:
> A structure or union shall not contain a member with incomplete or function type (hence,
a structure shall not contain an instance of itself, but may contain a pointer to an instance
of itself), except that the last member of a structure with more than one named member
may have incomplete array type; such a structure (and any union containing, possibly
recursively, a member that is such a structure) shall not be a member of a structure or an
element of an array.

0 Kudos
4 Replies
NoorjahanSk_Intel
Moderator
507 Views

Hi,

 

Thanks for reaching out to us.

 

Thank you for reporting this issue to us.

We are also able to reproduce the issue with the ICC compiler from our end.

We are working on it. We will get back to you soon.

 

Meanwhile, could you please try with icx compiler?  It is working as expected(throwing a warning) from our end with icx compiler.

 

Thanks & Regards,

Noorjahan.

 

0 Kudos
NoorjahanSk_Intel
Moderator
489 Views

Hi,


We have reported this issue to the development team, they are looking into this issue


Thanks & Regards,

Noorjahan.


0 Kudos
NoorjahanSk_Intel
Moderator
453 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,

Noorjahan.



0 Kudos
NoorjahanSk_Intel
Moderator
389 Views

Hi,

 

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.

As  It is working as expected(throwing a warning) from our end with icx compiler, we are going ahead and closing this issue.

 

Thanks & Regards,

Noorjahan.

 

0 Kudos
Reply