[Top][All Lists]

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

[lwip-devel] [bug #27521] Data type warning in api_msg.c

From: Eric Tron
Subject: [lwip-devel] [bug #27521] Data type warning in api_msg.c
Date: Fri, 25 Sep 2009 01:24:37 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322)


                 Summary: Data type warning in api_msg.c
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: friendfish
            Submitted on: Fri Sep 25 01:24:36 2009
                Category: None
                Severity: 3 - Normal
              Item Group: Compiler Warning
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: 1.3.1



In my compiler there always a warning appeared that is :
"Condition is always false".
The related source code is located in "api_msg.c" the "do_writemore" function
and that is:
"diff = conn->write_msg->msg.w.len - conn->write_offset;
if(diff>0xffffUL)"(in 1.3.1 version);

"if((conn->write_msg->msg.w.len - conn->write_offset > 0xffff))"(in 1.3.0).

the reason is obviously, the result is never larger than 0xffff, in 1.3.0
"msg.w.len" is defined as "u16_t" and "write_offset" is defined "u16_t" as
well. However in 1.3.1 both them are defined as "size_t", in some 16-bit cpu
the "size_t" is "unsgined int" is also 16bit data, so the condition is always

Now, I want dismiss the compiler warning, so I change the data type to
"u32_t", anyway, is that right? Would you give some proposal?


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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