lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] another compile issue about lwip-1.4.1


From: 薛佳元
Subject: [lwip-devel] another compile issue about lwip-1.4.1
Date: Sat, 3 Aug 2013 12:50:23 +0800 (CST)

Dear Bill:
            Thanks for your reply at first.
CASE 1:
             take your advice,I change the cc.h  as follow:
             1)
             #define PACK_STRUCT_FIELD(x)  x  
             #define PACK_STRUCT_STRUCT
             #define PACK_STRUCT_BEGIN   __packed
             #define PACK_STRUCT_END
             2)
             and add one important compile option: "--loose_implicit_cast"  at   armcc compiler command line
 
             Ha ha,  thanks god, this time no error, compile passed.
 CASE 2:
             1)
             #define PACK_STRUCT_FIELD(x)  __packed x  
             #define PACK_STRUCT_STRUCT
             #define PACK_STRUCT_BEGIN   __packed
             #define PACK_STRUCT_END
             2)
             and add one important compile option: "--loose_implicit_cast"  at   armcc compiler command line
 
            Goddam, compile result had just one error.
            Error: "struct pbuf" previously declared without __packed  ip_frag.c  line 93.
             So I track the code stop 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
             ----------------------------------------------------------------------
             I think I have found the problem:   "struct pbuf" prototype is not "__packed".  It cann't be forced to "__packed" in "struct ip_reass_helpler".    that may be a BUG under the situation about ARMCC compiler.
             Also, can you tell me the different about "#define PACK_STRUCT_FIELD(x)  x"  and 
"#define PACK_STRUCT_FIELD(x)  __packed x"
 
             Hope your reply and assistance, Thanks alot. 
 
             Circle.xue
 
 
 
 
 
 
 
==================================================================================================
------------------------------
Message: 2
Date: Fri, 2 Aug 2013 18:04:55 +0800 (CST)
From: ??? <address@hidden>
To: address@hidden, address@hidden
Subject: [lwip-devel] lwip-1.4.1  based on ADS IDE(RVDS2.2) compile
 failed
Message-ID: <address@hidden>
Content-Type: text/plain; charset="gbk"
Dear Sir:
          I am a LWIP  primary programmer.
          now,my project situation as below:
          uc/os-II(2.86)  + lwip(1.4.1 table) + RVDS2.2(armcc  IDE:ADS) + s3c6410
        
          case 1:
          in cc.h
           #define PACK_STRUCT_FIELD(x)   x __attribute__((packed))
           #define PACK_STRUCT_STRUCT   __attribute__((packed))
           #define PACK_STRUCT_BEGIN
           #define PACK_STRUCT_END
           compile pass!
                      I am so happy,  but "__attribute__((packed))" is the standard usage under GUN CC,my compiler is ARMCC.
           so I have to change to case 2.
 
          case 2:
          in cc.h
          #define PACK_STRUCT_FIELD(x)  __packed x
          #define PACK_STRUCT_STRUCT  
          #define PACK_STRUCT_BEGIN   __packed
          #define PACK_STRUCT_END
           this time compile failed as follow:
           argument of type "const __packed u8_t *" is incompatible with parameter of type "const void *"           
 
           I track the code stop at etharp.c  line 1340:
           "} else if (eth_addr_cmp(&ethhdr->dest, &ethbroadcast)) {"      
          and #define eth_addr_cmp(addr1, addr2) (memcmp((addr1)->addr, (addr2)->addr, ETHARP_HWADDR_LEN) == 0)
          I think I found the problem :
          prototype: int memcmp(constvoid*buf1,constvoid*buf2,unsignedintcount);
          but  &ethhdr->dest  and  &ethbroadcast   have something redundant"__packed"
 
          the problem is I should not modify your source code, so give me a solution please,I would appreciate so much!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nongnu.org/archive/html/lwip-devel/attachments/20130802/0aeaaec4/attachment.html>
------------------------------
Message: 3
Date: Fri, 2 Aug 2013 09:41:55 -0400
From: "Bill Auerbach" <address@hidden>
To: "'lwip-devel'" <address@hidden>
Subject: Re: [lwip-devel] lwip-1.4.1 based on ADS IDE(RVDS2.2) compile
 failed
Message-ID: <address@hidden>
Content-Type: text/plain; charset="us-ascii"
Hello,
 
cc.h is your file and you are free and even expected to change it.
 
Bill
 



reply via email to

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