dhcp.c and DHCP_OPTION_IDX_NTP_SERVER

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

dhcp.c and DHCP_OPTION_IDX_NTP_SERVER

Gisle Vanem-3
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
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: dhcp.c and DHCP_OPTION_IDX_NTP_SERVER

Dirk Ziegelmeier-2
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 <[hidden email]> 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
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel

_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel