Skip to content

Fix number_of_attempts narrowing - #802

Merged
NicolasFussberger merged 10 commits into
eclipse-score:mainfrom
etas-contrib:fix/number-of-attempts-narrowing
Oct 19, 2026
Merged

NicolasFussberger merged 10 commits into
eclipse-score:mainfrom
etas-contrib:fix/number-of-attempts-narrowing

Conversation

@cameron-craig-etas

@cameron-craig-etas cameron-craig-etas commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

#683

When building score/lifecycle with the "all warnings" configuration, we get a narrowing warning with number_of_attempts. This unsigned integer is stored in the flatbuffer as 32-bit, but narrowed to 8-bit when used. It makes sense to have a consistent sized type so we are now storing it in the flatbuffer as 8-bit. Some tests have been added where missing.

The valid values range form 0 to 255. Note that 255 is the maximum value of uint8_t.

Command to reproduce:

bazel build //score/launch_manager --config=x86_64-linux --features=all_wall_warnings

@cameron-craig-etas
cameron-craig-etas force-pushed the fix/number-of-attempts-narrowing branch from c3f590e to 0dc368c Compare October 16, 2026 09:19
@danth

danth commented Oct 16, 2026

Copy link
Copy Markdown
Member

I think limiting it to 8 bits is fine - I can't think of a case where you would want more than 254 attempts that couldn't be solved by just having a longer wait time between them.

@NicolasFussberger NicolasFussberger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks much simpler now, thanks for the refactor.

@cameron-craig-etas
cameron-craig-etas force-pushed the fix/number-of-attempts-narrowing branch from 7963fdf to b188787 Compare October 19, 2026 12:33
@cameron-craig-etas
cameron-craig-etas deployed to workflow-approval October 19, 2026 12:33 — with GitHub Actions Active
@cameron-craig-etas
cameron-craig-etas deployed to workflow-approval October 19, 2026 12:33 — with GitHub Actions Active
@cameron-craig-etas
cameron-craig-etas deployed to workflow-approval October 19, 2026 12:33 — with GitHub Actions Active
@cameron-craig-etas
cameron-craig-etas deployed to workflow-approval October 19, 2026 12:33 — with GitHub Actions Active
@NicolasFussberger
NicolasFussberger added this pull request to the merge queue Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Documentation preview for this pull request is available at:
pr-802: https://eclipse-score.github.io/lifecycle/pr-802/

Merged via the queue into eclipse-score:main with commit 18709dd Oct 19, 2026
20 checks passed
@NicolasFussberger
NicolasFussberger deleted the fix/number-of-attempts-narrowing branch October 19, 2026 12:59
@github-project-automation github-project-automation Bot moved this from Backlog to Done in LCM - Lifecycle & Health FT Oct 19, 2026

This branch was successfully deployed

1 active deployment
workflow-approval — b1887871 Deployed Oct 19, 2026 by cameron-craig-etas via Build and test unit-tests-x86_64-qnx / approval #1582
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants