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

fixed warning of integer comparsion #1056

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tolacika
Copy link

@tolacika tolacika commented May 3, 2024

I got this warning on build:

.pio\libdeps\esp01s\PubSubClient\src\PubSubClient.cpp: In member function 'boolean PubSubClient::publish_P(const char*, const uint8_t*, unsigned int, boolean)':
.pio\libdeps\esp01s\PubSubClient\src\PubSubClient.cpp:523:16: warning: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Wsign-compare]
  523 |     return (rc == expectedLength);
      |             ~~~^~~~~~~~~~~~~~~~~

I think the expected length should also be unsigned, negative length should not be interpreted.

@hmueller01
Copy link

Hey @tolacika, thanks for doing this PR. But this is a long known bug, see also #1045 first item I mentioned. I did a merge of all the suggestions in my fork and didn't get a negative response yet.
https://github.com/hmueller01/pubsubclient/tree/dev-fixes
Maybe you like to test this as well. Hope that @knolleary likes to merge all this here soon.

@tolacika
Copy link
Author

tolacika commented May 4, 2024

@hmueller01 thank you, I'll try it soon 😉

@CONSULitAS
Copy link

duplicate to #899

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