Fix broken SITL build: unbalanced #if SITL_BUILD in taskSystem() (merge #11727 artifact) - #11738
Merged
sensei-hacker merged 1 commit intoJul 20, 2026
Conversation
The release/9.1 merge (iNavFlight#11727) hit a conflict in taskSystem() where two independent fixes for the SITL load-accounting bug (iNavFlight#11710) — one from release/9.1, one from the mavlink stack — were concatenated instead of one being chosen. The result nested a duplicate '#if defined(SITL_BUILD)' block inside the '#else' branch, leaving the outer '#if' with no matching '#endif' and failing every SITL build with 'unterminated #else'. Remove the duplicated block, restoring the single intended (release/9.1) version. No functional change to load accounting; unit builds were unaffected (UNIT_TEST, not SITL_BUILD).
Contributor
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
sensei-hacker
merged commit Jul 20, 2026
27052b1
into
iNavFlight:maintenance-10.x
22 of 23 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
maintenance-10.xdoes not build for SITL. Every SITL build fails atscheduler.c:(plus a cascade of
-Werror=unused-function/unused-variableon the scheduler queue statics, because the malformed conditional excludes their users). Unit-test builds are unaffected — they defineUNIT_TEST, notSITL_BUILD, so the broken branch isn't compiled there and CI's unit jobs stay green while SITL is dead.Cause
taskSystem()had two independent fixes for the SITL load-accounting bug (#11710) land on different lines — one onrelease/9.1, one via the MAVLink stack — that both rewrote the same block. Therelease/9.1merge (#11727) resolved that conflict by concatenating both copies rather than choosing one: it kept therelease/9.1block as the outer#if defined(SITL_BUILD)and pasted the other copy inside the#elsebranch. The inner#endifthen closes the duplicate's#if, leaving the outer#if(line 131) with no matching#endif.Fix
Remove the duplicated
#if defined(SITL_BUILD)block from inside the#else, restoring the single intended (release/9.1) version. No functional change to load accounting — the two copies were the same wall-clock algorithm.Verified
SITL builds and links cleanly with
-Werrorafter the change.taskSystem()is now byte-identical to the intendedrelease/9.1version.