Skip to content

Fix byte issue, other warnings and deprecation #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

d-a-v
Copy link
Contributor

@d-a-v d-a-v commented Jun 28, 2021

These changes are backward compatible with older cores.
They will:

@@ -199,6 +199,7 @@ time_t NTPClient::getTime () {
}
#elif NETWORK_TYPE == NETWORK_ESP8266 || NETWORK_TYPE == NETWORK_ESP32
void NTPClient::s_dnsFound (const char *name, const ip_addr_t *ipaddr, void *callback_arg) {
(void)name;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this?

Copy link
Contributor Author

@d-a-v d-a-v Jul 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to avoid a compiler warning indicating that a parameter is unused.
It is visible when full & verbose logs are enabled in the arduino IDE preferences panel.
This idiom explicitly tells to the compiler to stay silent because we already know about that fact and that's on purpose.

Here's the warning:

libraries/NtpClient/src/NTPClientLib.cpp: In static member function 'static void NTPClient::s_dnsFound(const char*, const ip_addr_t*, void*)':
libraries/NtpClient/src/NTPClientLib.cpp:201:41: warning: unused parameter 'name' [-Wunused-parameter]
  201 | void NTPClient::s_dnsFound (const char *name, const ip_addr_t *ipaddr, void *callback_arg) {
      |                             ~~~~~~~~~~~~^~~~

Thanks for reviewing !

@bill-orange
Copy link

bill-orange commented Jul 21, 2021

Incorporating this pull request manually, I can compile with the ESP8266 3.0.1 board manager just fine. It also appears compatible with 2.7.4

@gmag11 gmag11 merged commit fbfbd33 into gmag11:master Jul 25, 2021
@d-a-v d-a-v deleted the fixByteIssueAndOtherWarningsAndDeprecation branch November 26, 2021 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants