Skip to content

Suppress -Wtype-limits on targets where long is 32-bits - #24

Open
ZERICO2005 wants to merge 3 commits into
mateoconlechuga:masterfrom
ZERICO2005:warning_suppress
Open

Suppress -Wtype-limits on targets where long is 32-bits#24
ZERICO2005 wants to merge 3 commits into
mateoconlechuga:masterfrom
ZERICO2005:warning_suppress

Conversation

@ZERICO2005

@ZERICO2005 ZERICO2005 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Three commits:

  • Fix trailing whitespace and line endings (excluding miniz.c and miniz.h since that is not our code)
  • Use -std=c99 instead of -std=c89 to avoid relying on C89 extensions (i.e. declarations after statements, long long, and _Bool/bool)
  • Suppress -Wtype-limits for miniz.c

Suppresses these warnings when long is 32-bits:

src\deps\miniz\miniz.c: In function 'mz_compress2':
src\deps\miniz\miniz.c:326:46: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  326 |     if ((mz_uint64)(source_len | *pDest_len) > 0xFFFFFFFFU)
      |                                              ^
src\deps\miniz\miniz.c: In function 'mz_uncompress2':
src\deps\miniz\miniz.c:569:48: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  569 |     if ((mz_uint64)(*pSource_len | *pDest_len) > 0xFFFFFFFFU)
      |                                                ^
( mkdir obj\deps\zx\zx7 2>nul || call )

Comment thread src/deps/miniz/miniz.c Outdated
@ZERICO2005 ZERICO2005 changed the title Warning suppress Suppress -Wtype-limits on targets where long is 32-bits Jul 7, 2026
@mateoconlechuga

Copy link
Copy Markdown
Owner

must upstream to miniz first: https://github.com/richgel999/miniz

@ZERICO2005

Copy link
Copy Markdown
Contributor Author

must upstream to miniz first: https://github.com/richgel999/miniz

They haven't fixed that warning yet (As of v3.1.2 (our repo has v3.0.2)). The more simple solution I have now implemented is to just add -Wno-type-limits when compiling miniz.c.

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