Hi,

On 22/04/2021 14:39, Arne Schwabe wrote:
> 
>>>  #ifndef _WIN32
>>> +    const char *device = tt->actual_name;
>>
>> This variable is not used in all cases embraced by "ifndef _WIN32".
>> I.e. I think it is not used when any of the following is defined:
>> TARGET_OPENBSD
>> TARGET_NETBSD
>> TARGET_AIX
>>
>> Therefore this change would fix *only* the warning on Windows.
>> Do we want to go this way? or should we rather rearrange the ifdefs a
>> bit so that we have a cleaner change/function?
> 
> 
> No all other platforms. The variable is used just 2 lines below it
> definition to set gateway_needed which is used by all platforms apart
> from _WIN32. So only WIN32 had this warning.

Well, it's assigned but not used on the platforms I mentioned.
I guess the compiler isn't able to throw a warning at the moment though.

Anyway, I am fine with keeping this change as it is. This code may
require some bigger restructuring at some point.
So fixing the usage of one variable only doesn't give us anything.

But at least this changes gets rid of a warning :)

> 
>>
>>
>>
>>>      if (r6->iface != NULL)              /* vpn server special route */
>>>      {
>>>          device = r6->iface;
>>> @@ -2713,7 +2713,7 @@ get_default_gateway_row(const MIB_IPFORWARDTABLE 
>>> *routes)
>>>              const DWORD index = row->dwForwardIfIndex;
>>>              const DWORD metric = row->dwForwardMetric1;
>>>  
>>> -            dmsg(D_ROUTE_DEBUG, "GDGR: route[%d] %s/%s i=%d m=%d",
>>> +            dmsg(D_ROUTE_DEBUG, "GDGR: route[%lu] %s/%s i=%d m=%d",
>>
>> shouldn't be enough to convert to %u ? (/me is not a DOWRD expert though)
> 
> No. DWORD is a long unsigned int as mentioned in the commit message. It
> is 32 bit int since Windows always has long as 32 bit. It is a bit
> confusing when you are used to the long=64 bit :)
> 
>>> index 2c1b270dd..4ef34e4eb 100644
>>> --- a/src/openvpn/tun.c
>>> +++ b/src/openvpn/tun.c
>>> @@ -5606,7 +5606,7 @@ windows_set_mtu(const int iface_index, const short 
>>> family,
>>>  
>>>      if (err != NO_ERROR)
>>>      {
>>> -        msg(M_WARN, "TUN: Setting %s mtu failed: %s [status=%u 
>>> if_index=%d]",
>>> +        msg(M_WARN, "TUN: Setting %s mtu failed: %s [status=%lu 
>>> if_index=%d]",
>>
>> same question as above.
>>

Thanks for the explanation on DWORD.

Compiled on my rig and no problem showed up.

Acked-by: Antonio Quartulli <anto...@openvpn.net>



-- 
Antonio Quartulli


_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to