Skip to content

Fix Conversion Warnings with Conservative Marking - #1385

Open
Aidan63 wants to merge 2 commits into
HaxeFoundation:masterfrom
Aidan63:mark-conservative-no-warn
Open

Fix Conversion Warnings with Conservative Marking#1385
Aidan63 wants to merge 2 commits into
HaxeFoundation:masterfrom
Aidan63:mark-conservative-no-warn

Conversation

@Aidan63

@Aidan63 Aidan63 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

After a comment in #1339 this is the first of probably a few PRs where I'm going through the IMMIX GC with all of clangs conversion warnings set to errors and fixing them up.
In this case I've gone through the conservative marking function and what it calls to make them compile even if you enable all of clangs warnings as errors. There are a few things going on here.

  • Curly bracket initialisation is now used, this forbids narrowing / lossy conversion which will silently happen other wise.
  • uintptr_t is used instead of size_t for pointer manipulation. As of C++11 this type is the standard sanctioned way for pointer editing.
  • C++ style casts are used instead of C-style.

For reference below is the clang pragma I used to enable all the warnings as errors, I put these just inside the MarkConservative function with a pragma pop at the end of the function to limit them to just that function and what it calls.

#pragma clang diagnostic push
#pragma clang diagnostic error "-Wconversion"
#pragma clang diagnostic error "-Wsign-conversion"
#pragma clang diagnostic error "-Wimplicit"
#pragma clang diagnostic error "-Wimplicit-int-conversion"
#pragma clang diagnostic error "-Wall"
#pragma clang diagnostic ignored "-Wunused-variable"
#pragma clang diagnostic ignored "-Wunused-but-set-variable"

Aidan Lee added 2 commits September 2, 2026 20:43
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