lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Compile problems


From: Sandra Gilge
Subject: [lwip-users] Compile problems
Date: Sun, 4 Oct 2015 18:16:42 +0200

Hallo 

Andy Pont wrote:
>> net/lwIP/src/core/inet_chksum.c:153:9: error: assuming that the loop 
>> counter does not overflow [-Werror=unsafe-loop-optimizations]
>>     while (len > 1) {
>>           ^

> I don't get this, but I'm running gcc 5.2.0 (MinGW-W64). Anyway, I can't
see the underflow issue here. Maybe you can try ">= 2" > > > instead of ">
1" 
> if it's a 5.1.0 bug?


Regarding the compile problem. It says assuming that the loop counter does
not overflow (not underflow)
The GCC manual helps here:
https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

-Wstrict-overflow
-Wstrict-overflow=n
    This option is only active when -fstrict-overflow is active. It warns
about cases where the compiler optimizes based on the assumption that signed
overflow does not occur. Note that it does not warn about all cases where
the code might overflow: it only warns about cases where the compiler
implements some optimization. Thus this warning depends on the optimization
level.

    An optimization that assumes that signed overflow does not occur is
perfectly safe if the values of the variables involved are such that
overflow never does, in fact, occur. Therefore this warning can easily give
a false positive: a warning about code that is not actually a problem. To
help focus on important issues, several warning levels are defined. No
warnings are issued for the use of undefined signed overflow when estimating
how many iterations a loop requires, in particular when determining whether
a loop will be executed at all.

etc.
So setting this option would help.

best regards,
Sandra


Message: 1
Date: Sat, 03 Oct 2015 20:21:45 +0200
From: "address@hidden" <address@hidden>
To: Mailing list for lwIP users <address@hidden>
Subject: Re: [lwip-users] Compile problems
Message-ID: <address@hidden>
Content-Type: text/plain; charset=windows-1252; format=flowed

Andy Pont wrote:
> net/lwIP/src/core/inet_chksum.c:153:9: error: assuming that the loop 
> counter does not overflow [-Werror=unsafe-loop-optimizations]
>     while (len > 1) {
>           ^

I don't get this, but I'm running gcc 5.2.0 (MinGW-W64). Anyway, I can't see
the underflow issue here. Maybe you can try ">= 2" instead of "> 1" 
if it's a 5.1.0 bug?

Simon



------------------------------

Message: 2
Date: Sun, 4 Oct 2015 11:53:28 +0200
From: Sylvain Rochet <address@hidden>
To: Mailing list for lwIP users <address@hidden>
Subject: Re: [lwip-users] Multi-Threaded netconn API TCP application
Message-ID: <address@hidden>
Content-Type: text/plain; charset="utf-8"

Hi,

On Thu, Oct 01, 2015 at 04:41:34PM +0300, Darius Babrauskas wrote:
> 
> Maybe, not was supported the Linux port. Strange, that gettimeofday 
> CLOCK_REALTIME was used long time.

I don't understand any of that.


> This can damage the test results. Exmp. NTP client can change 
> systemtime at each half hour, some seconds, when your testing LWIP.

No, that's not how NTP works on Linux. NTP does not step the system time, it
makes very small adjustments in the system clock frequency in order to slow
down or hurry up very very smoothly the system time. 
CLOCK_MONOTONIC is still affected by incremental NTP adjustments.

If you are talking about a NTP client called from time to time to set the
system clock, e.g: by calling ntpdate in a cronjob, then you are doing it
wrong, terribly wrong.

Embedded devices are of different concern, NTP is generally not used to
change a clock input used for timers or scheduler and very few devices are
adjusting a timer frequency based on the NTP timing data. Therefore it is
almost only used to output the current date in logs or human interfaces,
thus we don't care if it goes backward or forward a little bit.


Sylvain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL:
<http://lists.nongnu.org/archive/html/lwip-users/attachments/20151004/52ed30
45/attachment.pgp>

------------------------------

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

End of lwip-users Digest, Vol 146, Issue 4
******************************************




reply via email to

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