Skip to content
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

Warnings fix #56

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Warnings fix #56

wants to merge 6 commits into from

Conversation

HendrikRauh
Copy link
Owner

changed 2 things to fix warnings.
Im not sure if this will work like i think, so pls check

@@ -87,7 +87,7 @@ void onGetConfig(AsyncWebServerRequest *request)
doc["ip-method"] = config.getUInt("ip-method", DEFAULT_IP_METHOD);
doc["ip"] = ip.toString();
doc["subnet"] = subnet.toString();
doc["gateway"] = gateway != NULL ? gateway.toString() : "";
doc["gateway"] = gateway != 0 ? gateway.toString() : "";
Copy link
Owner Author

Choose a reason for hiding this comment

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

Gateway 0.0.0.0 will be "" then. Gateway 0.0.0.0 should be invalid anyway if im right.

@HendrikRauh HendrikRauh added the help wanted Extra attention is needed label Dec 18, 2024
RaffaelW
RaffaelW previously approved these changes Dec 18, 2024
Copy link
Collaborator

@RaffaelW RaffaelW left a comment

Choose a reason for hiding this comment

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

LGTM

@HendrikRauh
Copy link
Owner Author

Can we do anything about this warning?

src/main.cpp:54: warning: "ETH_SPI_HOST" redefined
 #define ETH_SPI_HOST SPI2_HOST

In file included from src/main.cpp:9:
lib/AsyncWebServer_ESP32_W5500/src/AsyncWebServer_ESP32_W5500.h:104: note: this is the location of the previous definition
     #define ETH_SPI_HOST            SPI3_HOST

@HendrikRauh
Copy link
Owner Author

Also we have this warning:

src/main.cpp: In function 'void setup()':
src/main.cpp:162:55: warning: passing NULL to non-pointer argument 2 of 'uint32_t Preferences::getUInt(const char*, uint32_t)' [-Wconversion-null]
     IPAddress gateway = config.getUInt("gateway", NULL);

It`s the same type i fixed above in this commit.

I am not sure if my approach will break anything, so I will leave it at that. Please have a look at this.

warning: passing NULL to non-pointer argument 2 of 'uint32_t Preferences::getUInt(const char*, uint32_t)' [-Wconversion-null]
@psxde pls check if this breaks functionality
@HendrikRauh HendrikRauh requested review from RaffaelW and removed request for RaffaelW December 20, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants