lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] dhcp.c and DHCP_OPTION_IDX_NTP_SERVER


From: Dirk Ziegelmeier
Subject: Re: [lwip-devel] dhcp.c and DHCP_OPTION_IDX_NTP_SERVER
Date: Sat, 1 Sep 2018 10:19:25 +0200

In this case, the warning is bogus - of course if only 1 server is configured, DHCP_OPTION_IDX_NTP_SERVER will have the same value as DHCP_OPTION_IDX_NTP_SERVER_LAST. I unfortunately don't have an idea at the moment how to fix this, so I can only recommend to turn this warning off (which I don't like - I tend to turn ON warnings whenever possible).

Dirk


On Thu, Aug 16, 2018 at 2:46 PM Gisle Vanem <address@hidden> wrote:
Building with clang-cl and '-DLWIP_DHCP_GET_NTP_SRV=1', gives
this pretty important warning:

   src/core/ipv4/dhcp.c(149,3):  warning: element DHCP_OPTION_IDX_NTP_SERVER has been
   implicitly assigned 10 which another element has been assigned [-Wduplicate-enum]
     DHCP_OPTION_IDX_NTP_SERVER,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
   src/core/ipv4/dhcp.c(150,3):  note: element DHCP_OPTION_IDX_NTP_SERVER_LAST also has value 10
     DHCP_OPTION_IDX_NTP_SERVER_LAST = DHCP_OPTION_IDX_NTP_SERVER + LWIP_DHCP_MAX_NTP_SERVERS - 1,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


<opt.h> has a default of 1 NTP-server:
   #define LWIP_DHCP_MAX_NTP_SERVERS  1

Compiling with 2 gives no warning.

Also, compiling 'core/ipv6/dhpcp6.c' with 'LWIP_DHCP6_MAX_DNS_SERVERS >= 1',
there's no warnings.

--
--gv

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

reply via email to

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