Hello,
I'm trying to compile lwip using Keil ARM compiler but it returns an error
in ip_frag.c :
lwip\src\core\ipv4\ip_frag.c(91): error: #1030: struct "struct pbuf"
previously declared without __packed
at
PACK_STRUCT_BEGIN
struct ip_reass_helper {
PACK_STRUCT_FIELD(struct pbuf *next_pbuf); <---------------
PACK_STRUCT_FIELD(u16_t start);
PACK_STRUCT_FIELD(u16_t end);
} PACK_STRUCT_STRUCT;
PACK_STRUCT_END
According to the doc of Keil compiler I have to use the define attribute
like this :
__packed struct foo
{
char one;
short two;
char three;
int four;
} c;
for a packed struct
struct foo
{
char one;
__packed short two;
char three;
int four;
} c;
for a packed field
So in cc.h I have this :
#ifndef PACK_STRUCT_BEGIN
#define PACK_STRUCT_BEGIN __packed
#endif /* PACK_STRUCT_BEGIN */
#ifndef PACK_STRUCT_END
#define PACK_STRUCT_END
#endif /* PACK_STRUCT_END */
#ifndef PACK_STRUCT_FIELD
#define PACK_STRUCT_FIELD(x) __packed x
#endif /* PACK_STRUCT_FIELD */
#ifndef PACK_STRUCT_STRUCT
#define PACK_STRUCT_STRUCT
#endif /* PACK_STRUCT_STRUCT */
It seems the compiler don't understand the field is a pointer to a struct
and not a structure itself .
I really don't know how to write it without getting an error :-(
Yann.