Repository navigation
build(image-source): compile the plugin's targets with the conversion warnings enabled (#2625) - #2753
Merged
Merged
Conversation
Nine -Wsign-conversion diagnostics, all of them a value the code already computed: the calldata setters take a long long and the slideshow indexes and file counts are size_t, rand() is non-negative, and the dstr_resize length is a pointer difference into a buffer that is in bounds. The same replay of the target's translation units with the three groups enabled reports zero diagnostics, rc 0 with -Werror still on. Refs #2625
Member
Author
|
Handed off to the coordinator. PR CI is green: Local evidence (in the description): the target's nine |
zackees
added a commit
that referenced
this pull request
Oct 28, 2026
… a float (#2625) #2753 enabled -Wfloat-conversion on the image-source target. GCC does not flag it, so the slice was green on Linux PR CI, but AppleClang reports it in the release lane's macOS app build: obs-slideshow.c.h:983 implicit conversion turns floating-point number into integer: 'float' to 'bool' [-Werror,-Wfloat-conversion] if (!ss->transition || !ss->slide_time) '!x' on a float is 'x == 0.0f' (NaN was already false), so the comparison is spelled out and the value tested is unchanged. Same verify-only run 40689520273 (arm64 job 122820591980) is the RED evidence.
This was referenced Oct 28, 2026
MCPVOT
pushed a commit
to MCPVOT/obs-studio
that referenced
this pull request
Oct 30, 2026
… ratchets (obs-rust#2625) (obs-rust#2789) * fix(text-freetype2): cast the two size_t arguments the macOS/Windows build flags (obs-rust#2625) obs-rust#2755 enabled -Wconversion/-Wsign-conversion on the text-freetype2 target, but the Linux lane never compiles find-font.c.h: the nix unity group uses find-font-unix.c.h, and find-font.c.h is only in the windows+ and macos+ groups. So the ratchet looked clean on Linux while the release lane's macOS and Windows app builds failed: find-font.c.h:58:30: da_resize(font_list, count) - int -> size_t find-font.c.h:218:31: da_reserve(sizes, face->num_fixed_sizes) - FT_Int -> size_t Both casts keep the value the code already passed (the implicit conversion happened inside da_resize/da_reserve). Red run 40684548610 (arm64 job 122803565099) is the evidence; reproduced locally by adding the find-font unity group to the Linux target for one build: find-font.c.h:58 conversion to size_t from int find-font.c.h:218 conversion to size_t from FT_Int -> after the casts: neither diagnostic (only the shadow error the temporary double include provokes on Linux, absent on the real Windows/macOS build). Refs obs-rust#2625 * fix(image-source): compare the slide time to zero instead of negating a float (obs-rust#2625) obs-rust#2753 enabled -Wfloat-conversion on the image-source target. GCC does not flag it, so the slice was green on Linux PR CI, but AppleClang reports it in the release lane's macOS app build: obs-slideshow.c.h:983 implicit conversion turns floating-point number into integer: 'float' to 'bool' [-Werror,-Wfloat-conversion] if (!ss->transition || !ss->slide_time) '!x' on a float is 'x == 0.0f' (NaN was already false), so the comparison is spelled out and the value tested is unchanged. Same verify-only run 40689520273 (arm64 job 122820591980) is the RED evidence.
MCPVOT
pushed a commit
to MCPVOT/obs-studio
that referenced
this pull request
Oct 30, 2026
…show (obs-rust#2625) (obs-rust#2803) obs-rust#2753 enabled -Wconversion/-Wsign-conversion/-Wfloat-conversion on the image-source target. obs-rust#2789 repaired the one finding that the release lane had reached by then, in obs-slideshow.c.h, but the plugin carries a legacy twin, obs-slideshow-mk2.c.h, which sits in the *core* unity group and has the same guard spelled the same way: plugins/image-source/obs-slideshow-mk2.c.h:830:31: error: implicit conversion turns floating-point number into integer: 'float' to '_Bool' [-Werror,-Wfloat-conversion] if (!ss->transition || !ssd->slide_time) GCC does not flag float-to-bool, so the slice was green on Linux PR CI; AppleClang reports it in the macOS app build, which PR CI never runs. Red evidence: verify-only dispatch 40699926737 (the dispatch this PR's branch was opened from), jobs 122858738716 (macos x86_64) and 122858739020 (macos arm64), both stop at that line; the matching Linux gate job for the same run was green. '!x' on a float is 'x == 0.0f' (a NaN slide time was already false), so the comparison is spelled out and the value tested is unchanged. Local reproduction with clang -Wfloat-conversion, stubbing the two fields: before: error: implicit conversion turns floating-point number into integer: 'float' to '_Bool' [-Werror,-Wfloat-conversion] after: clean Refs obs-rust#2625
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.
Slice of #2625 (drop the conversion pins). One target, as the issue's
acceptance criteria require: the pins cannot be deleted per directory.
RED —
970c73a0aplugins/image-source/CMakeLists.txtenables-Wconversion,-Wsign-conversionand-Wfloat-conversionon theimage-sourcetarget only(C sources). Replaying the target's Tier 2 unity translation units from the
build tree's compile database with the three
-Wno-*pins dropped and thegroups enabled reports nine diagnostics:
obs-slideshow.c.hsize_tindex ->long long(calldata_set_int)obs-slideshow.c.hsize_tcur_item->long longobs-slideshow.c.hsize_tfiles.num->long longobs-slideshow.c.hsize_t(dstr_resize)obs-slideshow-mk2.c.hrand()int->size_tobs-slideshow-mk2.c.hsize_tslide_idx->long longobs-slideshow-mk2.c.hsize_tslide_idx->long longobs-slideshow-mk2.c.hsize_tfiles.num->long longobs-slideshow-mk2.c.hsize_t(dstr_resize)GREEN —
843148db3Each conversion is made explicit at the call site and every cast keeps the
value the code already computed: the slideshow indexes and file counts are
bounded by the file array length,
rand()is non-negative, and thedstr_resizelength is astrrchroffset inside the dstr's own buffer. Thesame replay reports zero diagnostics, rc 0 with
-Werrorstill on.clang-format --dry-run --Werrorclean on both files,gersemi -cclean onthe CMake list,
./lintok (133 s).The global
-Wno-conversion/-Wno-sign-conversion/-Wno-float-conversionpins stay in the shared flag lists until every target is ratcheted; the last
slice deletes them.
Refs #2625