pack_struct_end.h errors when compiling with IAR

kat123 wrote on Monday, February 26, 2018:

When I add pack_struct_end.h and compile my code without any of my functions - just FreeRTOS provided code I get over 100 errors.

A lot of the errors seem to be along the lines of
Error[Pe065]: expected a “;” ProjectDirectory\Middlewares\Third_Party\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP.h 170
or
Error[Pe020]: identifier “___ inline” is undefined ProjectDirectory\Middlewares\Third_Party\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP.h 170

Is there a way to fix these errors?

jeronimo479 wrote on Monday, February 26, 2018:

Eclipse did the same thing to me. It would flag all the places where the “;” was supposed to be, but was located in the pack_struct_end.h file so it wasn’t recognized. I added an extra “;” before ‘typedef’. It doesn’t cause bad code, and get’s rid of the error.

#include “pack_struct_start.h”
struct xARP_HEADER
{
uint16_t usHardwareType; /* 0 + 2 = 2 /
uint16_t usProtocolType; /
2 + 2 = 4 /
uint8_t ucHardwareAddressLength; /
4 + 1 = 5 /
uint8_t ucProtocolAddressLength; /
5 + 1 = 6 /
uint16_t usOperation; /
6 + 2 = 8 /
MACAddress_t xSenderHardwareAddress; /
8 + 6 = 14 /
uint8_t ucSenderProtocolAddress[ 4 ]; /
14 + 4 = 18 /
MACAddress_t xTargetHardwareAddress; /
18 + 6 = 24 /
uint32_t ulTargetProtocolAddress; /
24 + 4 = 28 */
}
#include “pack_struct_end.h”
;typedef struct xARP_HEADER ARPHeader_t;

kat123 wrote on Monday, February 26, 2018:

I’ve checked the pack_struct_end.h file for IAR and it is just a “;” so I’m not sure what I would change to get it working in IAR

jeronimo479 wrote on Monday, February 26, 2018:

Add a semicolon after "#include “pack_struct_end.h”, on the next line.

rtel wrote on Monday, February 26, 2018:

Are these actual compiler errors? If so, please paste a few into the
forum. Somebody mentioned Eclipse previously, are you using Eclipse of
Embedded Workbench? Eclipse will try and parse C code itself and
display lots of errors in the IDE because it’s not very good at it - but
those are not compiler errors, or indeed anything to do with the
compiler and can be ignored (or you can tell Eclipse not to do it in the
project or workspace options).

kat123 wrote on Monday, February 26, 2018:

How do I check if they are compiler errors or IDE errors?

rtel wrote on Monday, February 26, 2018:

Compiler errors will appear in the console out window. You will see the
compiler’s command line being called to build a file, then the errors
and warnings output when building that file, before moving onto the next
file. The compiler’s hap hazard attempt at parsing C code generates
warnings and errors visible in the left margin of the editor window -
nothing to do with the running of the compiler or the output of the
compiler.

kat123 wrote on Tuesday, February 27, 2018:

I couldn’t find a console output in IAR but I have found replacing ‘__inline’ with ‘inline’ fixes the errors I’m seeing