lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] [PATCH 1/7] lwip: config sanity check for NETIP


From: Frédéric BERNON
Subject: Re: [lwip-users] [PATCH 1/7] lwip: config sanity check for NETIP
Date: Sat, 22 Sep 2007 10:46:03 +0200

 
>>About the comment, it's "trivial", but a comment never kill everyone.

>I don't understand what you mean by this, can you please clarify? The patch added a comment to the code to explain why realloc() was a stub and the commit >documented the issue it fixed.
Hi Andrew,
 
Sorry, my english is not very good (I'm french). and sometimes, it can cause some problems. What I want to say is the comment is not very useful, since the code is very simple, but could be add with the patch (if the patch is added) because it don't cause any problems. I think my _expression_ is very specific to my country, and doesn't have a sens with such translation, sorry.
 
About the patch itself, if what you propose fix your compiler warning, it generate warnings "_expression_ is constant" on some others compilers, due the "while (0)". So, fix warnings on one compiler which generate warnings on others is not a good idea (it would be good that all compilers in the world have the same behavior, but, I suppose we can continue to dream... ;) ). Sometimes, we can have some configurable workaround: by example, that why we have a macro LWIP_UNUSED_ARG. It seems the best solution to avoid warnings is to reduce the compiler "warning level", or to live with them (by example, the SNMP code give lots a warnings in my compilers). Last, for this specific warning, it's coherent with most/lot(?) of others lwip files (take sys.h in the NO_SYS=1 part). Don't forget that mem_realloc is not a stub if MEM_LIBC_MALLOC=1 (in this case, it redefined C runtime realloc).
 
I hope my explanation is more clear now...
 
----- Original Message -----
Sent: Saturday, September 22, 2007 8:38 AM
Subject: Re: [lwip-users] [PATCH 1/7] lwip: config sanity check for NETIP

On 9/21/07, Frédéric BERNON <address@hidden> wrote:

[lwip-users] [PATCH 4/7] lwip: fix warning 'code has no effect' where mem_realloc was used
To be honest, since we could/should(?) use mem_realloc like this : "pr = mem_realloc(p,x)", your change doesn't work.

I made this change becaure the rval was never used and gave a warning with my compiler.

Yes - if someone does make a change like you describe they will get a compile error, but I would suggest that in this case mem_realloc shound no-longer be a stub? Personally I think a compile error is a good thing in this case.

About the comment, it's "trivial", but a comment never kill everyone.

I don't understand what you mean by this, can you please clarify? The patch added a comment to the code to explain why realloc() was a stub and the commit documented the issue it fixed.
Andrew


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

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