Skip to content

Commit a607ca2

Browse files
Fix build error with Werror=sign-compare is enabled (#283)
<!--- 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.
1 parent ce8bb2a commit a607ca2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
-DCMAKE_BUILD_TYPE=Debug \
3333
-DBUILD_CLONE_SUBMODULES=ON \
3434
-DUNITTEST=1 \
35-
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG -DLIBRARY_LOG_LEVEL=LOG_DEBUG'
35+
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Wsign-compare -Werror -DNDEBUG -DLIBRARY_LOG_LEVEL=LOG_DEBUG'
3636
make -C build/ all
3737
echo "::endgroup::"
3838

source/core_mqtt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2217,7 +2217,7 @@ static MQTTStatus_t sendConnectWithoutCopy( MQTTContext_t * pContext,
22172217
pWillInfo,
22182218
remainingLength );
22192219

2220-
assert( ( pIndex - connectPacketHeader ) <= sizeof( connectPacketHeader ) );
2220+
assert( ( ( size_t ) ( pIndex - connectPacketHeader ) ) <= sizeof( connectPacketHeader ) );
22212221

22222222
/* The header gets sent first. */
22232223
iterator->iov_base = connectPacketHeader;

0 commit comments

Comments
 (0)