Skip to content

chore: Silence two compiler signedness warnings - #8553

Merged
nbolton merged 1 commit into
deskflow:masterfrom
whot:wip/signedness-warning
Apr 30, 2025
Merged

chore: Silence two compiler signedness warnings#8553
nbolton merged 1 commit into
deskflow:masterfrom
whot:wip/signedness-warning

Conversation

@whot

@whot whot commented Apr 30, 2025

Copy link
Copy Markdown
Contributor

Both trigger:
warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]

In the first hunk we already checked for i < 0 so casting to size_t is fine. In the second hunk we don't use i so we can pick the right type.

@sithlord48
sithlord48 self-requested a review April 30, 2025 01:49
Comment thread src/lib/base/String.cpp Outdated
Both trigger:
  warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]

In the first hunk we already checked for i < 0 so casting to size_t is
fine. In the second hunk we don't use i so we can pick the right type.
@whot
whot force-pushed the wip/signedness-warning branch from 6315d8e to 500705b Compare April 30, 2025 03:29
@nbolton
nbolton enabled auto-merge (rebase) April 30, 2025 10:33
@nbolton
nbolton dismissed sithlord48’s stale review April 30, 2025 11:04

Static cast was used, I'll assume you're happy.

@nbolton
nbolton merged commit 59df2db into deskflow:master Apr 30, 2025
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