lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Trouble at compile time with __packed attribute.


From: Yann Suisini
Subject: [lwip-users] Trouble at compile time with __packed attribute.
Date: Fri, 9 Oct 2009 04:01:04 -0700 (PDT)

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.

 


-- 
View this message in context: 
http://www.nabble.com/Trouble-at-compile-time-with-__packed-attribute.-tp25819211p25819211.html
Sent from the lwip-users mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]