Fix NAV_MAX_WAYPOINTS redefinition breaking FISHDRONEF4 build - #11739
Conversation
target/common.h unconditionally defines NAV_MAX_WAYPOINTS (120), and FISHDRONEF4/target.h and src/test/unit/target.h each override it to 60 with a bare #define instead of the #undef+#define pattern used elsewhere in the tree (e.g. SITL/target.h) for the same situation. Under -Werror this is a fatal "redefined" diagnostic, breaking the FISHDRONEF4 build. Pre-existing since a 2016 consolidation of NAV_MAX_WAYPOINTS into common.h that missed these two files - not introduced by any recent change. Add the missing #undef before each override. No resolved value changes for either target.
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? |
|
Isn't the |
I don't know why they set that. Maybe they had a good reason , maybe not. It has been SKIP_RELEASES for 10 years, so I don't suppose it matters much. 60 is a lot of waypoints anyway. :) |
30225d3
into
iNavFlight:maintenance-10.x
NAV_MAX_WAYPOINTS was set for each target originally. Then around the time FISHDRONEF4 was added NAV_MAX_WAYPOINTS was removed from the each target and moved to common.h. NAV_MAX_WAYPOINTS probably got overlooked and left in the FISHDRONEF4 target.h file at that time. Anyway if it's SKIP_RELEASES it doesn't really matter. |
Summary
target/common.hunconditionally definesNAV_MAX_WAYPOINTS(120).FISHDRONEF4/target.handsrc/test/unit/target.heach override it to 60 with a bare#defineinstead of the#undef+#definepattern used elsewhere in the tree (e.g.SITL/target.h) for this same situation. Under-Werrorthis is a fatal "redefined" diagnostic that breaks the FISHDRONEF4 build.This is pre-existing tech debt from a 2016 consolidation of
NAV_MAX_WAYPOINTSintocommon.h(and a same-day follow-up cleanup pass) that missed these two files — not something introduced by any recent change. Checked all 231target.hfiles undersrc/main/target/for any other occurrence; these are the only two affected.Changes
#undef NAV_MAX_WAYPOINTSimmediately before the existing override insrc/main/target/FISHDRONEF4/target.h.src/test/unit/target.h.NAV_MAX_WAYPOINTSremains 60 for both targets, before and after.Testing
-DWARNINGS_AS_ERRORS=ON: failed before the fix ("NAV_MAX_WAYPOINTS" redefined [-Werror]), builds clean after (0 warnings/errors, confirmed by reverting the fix and rebuilding in a separate clean directory to verify causation, not just correlation).mavlink_unittest(top-level CMake,-DTOOLCHAIN=none): 62/62 passing, no regressions.Code Review
Reviewed with the inav-code-review agent — approved, no issues found. Confirmed the fix matches existing codebase convention (
SITL/target.h) and doesn't change any resolved configuration value.