lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] cannot establish connection if vj.c is optimized with -


From: David Brown
Subject: Re: [lwip-users] cannot establish connection if vj.c is optimized with -O2 option
Date: Mon, 16 Dec 2019 13:08:12 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 13/12/2019 22:39, Sylvain Rochet wrote:
> Hi,
> 
> On Thu, Dec 12, 2019 at 10:04:19AM -0700, mav wrote:
>> Hi, everybody. Maybe this is some type conversion issue, because vj.c throws
>> many type conversion warnings, if latter enabled. As Sylvain recommends I
>> would disable VJ for my project for good! Thank you for your answers. 
> 
> I also asked why do you need VJ in order to decide whether I should bury 
> it in non-working features or to try to fix it once for all. So, I'm 
> asking it again:
> 
> Why do you need VJ for ? It is useless with cellular modems, it is
> useless in PPPoE and PPPoL2TP, AFAIK the last user was dial-up modems,
> are they still used in the wild ?
> 

If you suspect type aliasing problems, then you might add this quick and
dirty workaround to the top of the relevant C files:

#ifdef __GNUC__
#pragma GCC optimize "-fno-strict-aliasing"
#endif


Obviously the ideal answer is to fix the code, but that might not be
practical or worth the effort.  This kind of forced compiler option is a
reasonable compromise, because it makes the code safe regardless of the
compiler options picked by the programmer and the build system
(assuming, of course, you have #ifdef's covering the relevant compilers).

You can even do:

#ifdef __GNUC__
#pragma GCC optimize "-O1"
#endif

to avoid -O2 optimisations.




reply via email to

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