Skip to content

fix: suppress warnings about unused llvm flags#16

Merged
rioam2 merged 1 commit into
mainfrom
rioam2/fix-unused-parameter-warnings
Feb 28, 2026
Merged

fix: suppress warnings about unused llvm flags#16
rioam2 merged 1 commit into
mainfrom
rioam2/fix-unused-parameter-warnings

Conversation

@rioam2

@rioam2 rioam2 commented Feb 28, 2026

Copy link
Copy Markdown
Owner

This pull request updates the initialize_wasi_toolchain function in wasi-sdk.toolchain.cmake to improve compatibility with older versions of clang and clarify linker flag usage. Ensures that certain -mllvm flags do not trigger unused argument warnings, and library linking for exception and setjmp/longjmp support is made more explicit.

  • Wrapped -mllvm flags with --start-no-unused-arguments and --end-no-unused-arguments in both CMAKE_C_FLAGS and CMAKE_CXX_FLAGS to avoid unused argument warnings in older clang versions. [1] [2]
  • Moved -fwasm-exceptions to only be appended to CMAKE_CXX_FLAGS and clarified linking against libunwind for exception handling by using -lunwind in CMAKE_EXE_LINKER_FLAGS.
  • Clarified linking against the setjmp library for setjmp/longjmp support by using -lsetjmp in CMAKE_EXE_LINKER_FLAGS.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts initialize_wasi_toolchain() to reduce “unused argument” warnings from clang when passing WebAssembly-related -mllvm flags, and to make exception / setjmp linkage more explicit via linker flags.

Changes:

  • Wraps -mllvm WebAssembly backend flags with --start-no-unused-arguments / --end-no-unused-arguments for both C and C++ flags.
  • Moves exception enablement to CMAKE_CXX_FLAGS and moves libunwind linkage to CMAKE_EXE_LINKER_FLAGS.
  • Moves setjmp linkage to CMAKE_EXE_LINKER_FLAGS and applies the same unused-argument suppression wrapping for SJLJ-related -mllvm flags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wasi-sdk.toolchain.cmake Outdated
Comment thread wasi-sdk.toolchain.cmake Outdated
Comment thread wasi-sdk.toolchain.cmake Outdated
@rioam2 rioam2 force-pushed the rioam2/fix-unused-parameter-warnings branch from c6202d5 to 27bca0d Compare February 28, 2026 10:16
@rioam2 rioam2 force-pushed the rioam2/fix-unused-parameter-warnings branch from 27bca0d to 2a9ee0c Compare February 28, 2026 10:18
@rioam2 rioam2 merged commit b032d4f into main Feb 28, 2026
5 checks passed
@rioam2 rioam2 deleted the rioam2/fix-unused-parameter-warnings branch February 28, 2026 10:36
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