Skip to content

Enable -Wdouble-promotion by default and fix related warnings#4603

Merged
lum1n0us merged 12 commits intobytecodealliance:mainfrom
TianlongLiang:dev/fix_warning
Sep 12, 2025
Merged

Enable -Wdouble-promotion by default and fix related warnings#4603
lum1n0us merged 12 commits intobytecodealliance:mainfrom
TianlongLiang:dev/fix_warning

Conversation

@TianlongLiang
Copy link
Copy Markdown
Contributor

No description provided.

@yamt
Copy link
Copy Markdown
Contributor

yamt commented Sep 8, 2025

  • doesn't -Wdouble-promotion warn on return NAN in f64_min/f64_max?
  • do you plan to enable -Wdouble-promotion by default?

@TianlongLiang TianlongLiang marked this pull request as draft September 8, 2025 02:46
@TianlongLiang
Copy link
Copy Markdown
Contributor Author

  • doesn't -Wdouble-promotion warn on return NAN in f64_min/f64_max?

You are right about NAN., I plan to explicitly convert it like return (double)NAN;

  • do you plan to enable -Wdouble-promotion by default?

Yes, I plan to enable -Wdouble-promotion by default, I think it can benefit some embedded platforms.

@yamt
Copy link
Copy Markdown
Contributor

yamt commented Sep 8, 2025

  • doesn't -Wdouble-promotion warn on return NAN in f64_min/f64_max?

You are right about NAN., I plan to explicitly convert it like return (double)NAN;

  • do you plan to enable -Wdouble-promotion by default?

Yes, I plan to enable -Wdouble-promotion by default, I think it can benefit some embedded platforms.

ok. it makes sense.

@lum1n0us lum1n0us added the bug-fix Determine if this PR addresses a bug. It will be used by scripts to classify PRs. label Sep 9, 2025
Comment thread core/iwasm/aot/aot_intrinsic.c Outdated
@TianlongLiang TianlongLiang changed the title Fix compile warning -Wdouble-promotion on some platform Enable -Wdouble-promotion by default and fix some warnings Sep 10, 2025
@TianlongLiang TianlongLiang changed the title Enable -Wdouble-promotion by default and fix some warnings Enable -Wdouble-promotion by default and fix related warnings Sep 10, 2025
@TianlongLiang TianlongLiang marked this pull request as ready for review September 10, 2025 06:26
Comment thread build-scripts/runtime_lib.cmake Outdated
Comment thread build-scripts/warnings.cmake
@lum1n0us lum1n0us merged commit d7afa4c into bytecodealliance:main Sep 12, 2025
453 checks passed
kr-t pushed a commit to project-ocre/wasm-micro-runtime that referenced this pull request Nov 13, 2025
…dealliance#4603)

- fix float to double implicit conversion
- add isnanf and signbitf macros, map them to existing double version when float versions are absent
- enable -Wdouble-promotion by default
- define isnan as macro for platform use core\sahred\platform\common\math.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix Determine if this PR addresses a bug. It will be used by scripts to classify PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants