C: remove broken and unused put_bitfield_n_by_index helper - #1227
Open
julianoes wants to merge 1 commit into
Open
C: remove broken and unused put_bitfield_n_by_index helper#1227julianoes wants to merge 1 commit into
julianoes wants to merge 1 commit into
Conversation
put_bitfield_n_by_index() is dead code: it is never called by any
generated message code or generator template, and the MAVLink wire
format has no sub-byte bitfield field type (fields are byte-aligned
scalars/arrays only), so nothing can drive a call to it.
It is also buggy: the packing line
buffer[i_byte_index] |= ((0x00 << curr_bits_n) & v);
masks the value with 0, so any bits packed would come out as zero. As
the only way to reach it is to call this public helper directly from
application code, remove it (and its MAVLINK_SEPARATE_HELPERS forward
declaration) from the v1.0 and v2.0 fixed headers rather than fix and
maintain an untested feature with no users. The frozen v0.9 headers are
left untouched.
tridge
force-pushed
the
remove-dead-bitfield-helper
branch
from
July 29, 2026 03:09
0953267 to
0264928
Compare
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.
Disclaimer: found by Claude.
put_bitfield_n_by_index()seems to be dead code, and not doing anything if used anywhere.