Skip to content

Commit

Permalink
Fix build error with Werror=sign-compare is enabled (#283)
Browse files Browse the repository at this point in the history
<!--- Title -->

Description
-----------
This PR fixes a build issue when `Werror=sign-compare` is enabled while
building the library.

Test Steps
-----------
<!-- Describe the steps to reproduce. -->

Checklist:
----------
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
- [x] I have tested my changes. No regression in existing tests.
- ~[ ] I have modified and/or added unit-tests to cover the code changes
in this Pull Request.~

Related Issue
-----------
#282 

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
  • Loading branch information
tony-josi-aws authored Apr 25, 2024
1 parent ce8bb2a commit a607ca2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_CLONE_SUBMODULES=ON \
-DUNITTEST=1 \
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG -DLIBRARY_LOG_LEVEL=LOG_DEBUG'
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Wsign-compare -Werror -DNDEBUG -DLIBRARY_LOG_LEVEL=LOG_DEBUG'
make -C build/ all
echo "::endgroup::"
Expand Down
2 changes: 1 addition & 1 deletion source/core_mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2217,7 +2217,7 @@ static MQTTStatus_t sendConnectWithoutCopy( MQTTContext_t * pContext,
pWillInfo,
remainingLength );

assert( ( pIndex - connectPacketHeader ) <= sizeof( connectPacketHeader ) );
assert( ( ( size_t ) ( pIndex - connectPacketHeader ) ) <= sizeof( connectPacketHeader ) );

/* The header gets sent first. */
iterator->iov_base = connectPacketHeader;
Expand Down

0 comments on commit a607ca2

Please sign in to comment.