Fix GCC 15 warnings (shift-negative-value, pointer-to-int-cast) - #113
Fix GCC 15 warnings (shift-negative-value, pointer-to-int-cast)#113Bwooce wants to merge 2 commits into
Conversation
|
Verified compilation and execution with Clang 18 on Linux. No warnings observed. |
|
Additional testing: Verified decoding of external standard test image (landscape.jpg, 1800x1200). 'small.jpg' (minimal 107 bytes) failed with INVALID_FILE, likely due to strict header requirements or missing tables. |
|
Definitive testing: Downloaded official IJG test images (jpeg-9e). Successfully decoded 'testimg.jpg' (baseline) and 'testimgp.jpg' (progressive). |
|
Reverted the pointer cast changes (restored original int64_t cast) as they were likely unnecessary/incorrect. Kept the shift-negative-value and uninitialized variable fixes. |
|
Final Verification: Confirmed compilation with GCC 15.2.0 (riscv32-esp-elf-g++) using -Wall -Werror. The code is clean and the earlier reported GCC 15 issues are fully resolved. |
|
(and full disclosure, PR driven with Claude. The reason this PR exists is that ESP32 IDF 6.0 uses GCC 15, and so projects using it + warnings-as-errors start failing due to the new warnings). The new initialisation surely has some overhead, and I don't think I'm versed enough in compiler vs undefined behaviour to know if was 100% safe before. |
|
got a moment to review @bitbank2 ? Alternatively I can turn off warnings-as-errors in epdiy but that doesn't seem like a great path. |
Fixed implicit left shift of negative value and pointer-to-int cast warnings treated as errors in GCC 15.\n\nChanges:\n- Cast -1 to uint32_t before left shifting to avoid negative value shift.\n- Use intptr_t for pointer casting to avoid pointer-to-int-cast warnings/errors.\n- Initialize xmmIn variable to avoid uninitialized usage warning.