Fix build warnings on Linux#924
Open
davidhealey wants to merge 1 commit intochristophhart:developfrom
Open
Conversation
Add required 'template' keyword before dependent template name when calling p.connect<P>(dst) where p is a dependent expression. https://claude.ai/code/session_011oaJHUxVahg6svtz22UgD2 Fix Linux build warnings in RestHelpers.cpp and mir-gen.c - Remove apostrophe from comment in #if 0 block in RestHelpers.cpp to fix "missing terminating ' character" tokenizer warning - Add #undef DEBUG before redefining it in mir-gen.c to fix "DEBUG redefined" warning caused by command-line -DDEBUG definition https://claude.ai/code/session_01QKATiMNcmsfMd3cEn4Z4S8 Fix Linux -Wreturn-type warnings in snex by marking throw functions [[noreturn]] Mark CodeLocation::throwError, TokenIterator::throwTokenMismatch, and Operations::Statement::throwError as [[noreturn]] since they always throw. This fixes four GCC -Wreturn-type warnings caused by RETURN_DEBUG_ONLY expanding to nothing in release builds, leaving no return statement after the always-throwing calls. https://claude.ai/code/session_01QKATiMNcmsfMd3cEn4Z4S8 Fix GCC -Wstringop-overflow warning in stb_image.h Change tc[3] to tc[4] in stbi__parse_png_file. GCC warns because the loop iterates up to s->img_n times, and img_n can be 4. The guard (s->img_n & 1) means only odd values (1 or 3) reach this code path, so tc[3] is safe in practice, but enlarging to tc[4] silences the false-positive warning. https://claude.ai/code/session_01QKATiMNcmsfMd3cEn4Z4S8 Fix out-of-bounds write to currentNotes[] in ModulatorSampler getNoteNumber() + getTransposeAmount() can exceed [0,127] when a transpose is applied, writing beyond the end of the 128-element currentNotes array (UB flagged by -Waggressive-loop-optimizations, iteration 127). Apply jlimit(0, 127, ...) consistent with the existing bounds check in resetNoteDisplay(). The repeated -Wfree-nonheap-object 'emptyString' warnings are a GCC false positive in JUCE's StringHolder::release(): the check against the static emptyString pointer is logically correct but not visible to the optimiser after inlining. The fix is to restructure that function to use an early return when b == &emptyString so the delete[] path is in a clearly separate branch. This requires modifying juce_String.cpp in the JUCE submodule (christophhart/JUCE_customized, juce6 branch). https://claude.ai/code/session_01QKATiMNcmsfMd3cEn4Z4S8 Fix off-by-one in noteColours array causing -Waggressive-loop-optimizations Array was declared as [127] but accessed with indices 0-127 (128 elements). Iteration 127 was UB; correct size is [128]. https://claude.ai/code/session_01QKATiMNcmsfMd3cEn4Z4S8 Fix -Wstringop-overflow in memcpy call in getBitReductionForDifferential Cast b.size to size_t before multiplying to prevent GCC from inferring a potentially-negative signed int being passed as memcpy's size argument. https://claude.ai/code/session_01QKATiMNcmsfMd3cEn4Z4S8
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.
Add required 'template' keyword before dependent template name when calling p.connect
(dst) where p is a dependent expression.
https://claude.ai/code/session_011oaJHUxVahg6svtz22UgD2
Fix Linux build warnings in RestHelpers.cpp and mir-gen.c
https://claude.ai/code/session_01QKATiMNcmsfMd3cEn4Z4S8
Fix Linux -Wreturn-type warnings in snex by marking throw functions [[noreturn]]
Mark CodeLocation::throwError, TokenIterator::throwTokenMismatch, and Operations::Statement::throwError as [[noreturn]] since they always throw. This fixes four GCC -Wreturn-type warnings caused by RETURN_DEBUG_ONLY expanding to nothing in release builds, leaving no return statement after the always-throwing calls.
https://claude.ai/code/session_01QKATiMNcmsfMd3cEn4Z4S8
Fix GCC -Wstringop-overflow warning in stb_image.h
Change tc[3] to tc[4] in stbi__parse_png_file. GCC warns because the loop iterates up to s->img_n times, and img_n can be 4. The guard (s->img_n & 1) means only odd values (1 or 3) reach this code path, so tc[3] is safe in practice, but enlarging to tc[4] silences the false-positive warning.
https://claude.ai/code/session_01QKATiMNcmsfMd3cEn4Z4S8
Fix out-of-bounds write to currentNotes[] in ModulatorSampler
getNoteNumber() + getTransposeAmount() can exceed [0,127] when a transpose is applied, writing beyond the end of the 128-element currentNotes array (UB flagged by -Waggressive-loop-optimizations, iteration 127). Apply jlimit(0, 127, ...) consistent with the existing bounds check in resetNoteDisplay().
The repeated -Wfree-nonheap-object 'emptyString' warnings are a GCC false positive in JUCE's StringHolder::release(): the check against the static emptyString pointer is logically correct but not visible to the optimiser after inlining. The fix is to restructure that function to use an early return when b == &emptyString so the delete[] path is in a clearly separate branch. This requires modifying juce_String.cpp in the JUCE submodule (christophhart/JUCE_customized, juce6 branch).
https://claude.ai/code/session_01QKATiMNcmsfMd3cEn4Z4S8
Fix off-by-one in noteColours array causing -Waggressive-loop-optimizations
Array was declared as [127] but accessed with indices 0-127 (128 elements). Iteration 127 was UB; correct size is [128].
https://claude.ai/code/session_01QKATiMNcmsfMd3cEn4Z4S8
Fix -Wstringop-overflow in memcpy call in getBitReductionForDifferential
Cast b.size to size_t before multiplying to prevent GCC from inferring a potentially-negative signed int being passed as memcpy's size argument.
https://claude.ai/code/session_01QKATiMNcmsfMd3cEn4Z4S8