Skip to content

dwarf: use unsigned loop index in LEB128 readers - #50

Open
sreekotay wants to merge 1 commit into
TinyCC:mobfrom
sreekotay:pr/dwarf-leb128-unsigned-i
Open

dwarf: use unsigned loop index in LEB128 readers#50
sreekotay wants to merge 1 commit into
TinyCC:mobfrom
sreekotay:pr/dwarf-leb128-unsigned-i

Conversation

@sreekotay

Copy link
Copy Markdown

Summary

  • In dwarf_read_uleb128 / dwarf_read_sleb128, the loop index i is compared against DWARF_MAX_128 and used only as a shift count.
  • Change int i to unsigned i to quiet -Wsign-compare under stricter warning builds.

Test plan

  • Build with -Wsign-compare (or the project default warning set) and confirm the two LEB128 readers no longer warn
  • Existing DWARF / debug-info tests still pass

Made with Cursor

@sreekotay
sreekotay force-pushed the pr/dwarf-leb128-unsigned-i branch from bd04b01 to 5f5d687 Compare August 11, 2026 05:08
Quiet -Wsign-compare in dwarf_read_uleb128 / dwarf_read_sleb128:
the bound is DWARF_MAX_128 (unsigned-friendly) and i is only used
as a shift count.
@sreekotay
sreekotay force-pushed the pr/dwarf-leb128-unsigned-i branch from 5f5d687 to 8986ac9 Compare August 11, 2026 05:09
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.

1 participant