Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*

Strange Compile error with Intel CC

MG12
New Contributor I
922 Views

I try to use the last version of the Intel C Compler and successuflly added it into Visual Studio 2022.

I run into an compiler error that I dont get rid off.

We used to apply prototype definitions often using forward definitions for structs, like this:

Prototype in a header file:

void testfoo(struct _FAA *nn);

C-Code:

typedef struct _FAA
{
int b;
}FAA;

void testfoo(FAA *aa)
{
aa->b = 0;
}

On compiling I get this error:

code.c(277,6): : error : conflicting types for 'testfoo'
1>void testfoo(FAA *aa)
1> ^
1>code.h(204,6): note: previous declaration is here
1>void testfoo(struct _FAA *nn);
1> ^

 

Seems the compiler doesnt like our forward declations of structs, but why ?

This was not a problem with the compiler 2 years ago, but now with the recent

download.

Any tips ? Maybe a compiler flag that I missed ?

Thanks you!

Marcus

0 Kudos
1 Reply
NoorjahanSk_Intel
Moderator
885 Views

Hi,


Thanks for posting in Intel Communities.

Since this is a duplicate thread of https://community.intel.com/t5/Intel-C-Compiler/Moved-Strange-compiler-error-on-forward-declarations/m-p/1497397#M41027, we will no longer monitor this thread. We will continue addressing this issue in the other thread.


Thanks & Regards,

Noorjahan.


0 Kudos
Reply