Skip to content

Silence warnings#17713

Merged
LibretroAdmin merged 4 commits intolibretro:masterfrom
pstef:silence-warnings
Mar 20, 2025
Merged

Silence warnings#17713
LibretroAdmin merged 4 commits intolibretro:masterfrom
pstef:silence-warnings

Conversation

@pstef
Copy link
Copy Markdown
Contributor

@pstef pstef commented Mar 19, 2025

Silence -Walloc-size-larger-than=byte-size
Silence GCC stringop-overflow
Silence warning: left shift of negative value
Silence a dangling-pointer warning in Lzma

pstef added 4 commits March 19, 2025 17:35
One of the GCC14's optimization heuristic triggered here, suggesting
that the special value of len (size_t) could potentially be lesser than
the file's size (int64_t) but greater than "maximum object size" (set by
byte-size, PTRDIFF_MAX by default).

Use the same type as the file size it's compared to, and adjust the
sentinel value to spell INT64_MAX.
At optimization level -O3, GCC generates a warning about its own
optimizations, likely due to loop unrolling. Manually unroll the loop to
eliminate any ambiguity and prevent the warning.
Import the change from upstream 16c83cd5fc4c18954c1b6e3de16c37ba
@LibretroAdmin LibretroAdmin merged commit f7b4af8 into libretro:master Mar 20, 2025
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.

2 participants