Skip to content

Conversation

@aheejin
Copy link
Member

@aheejin aheejin commented Jan 3, 2026

Additional changes:

  • Add -Wno-c23-extensions to libunwind's cflags: 0070206
    Silence -Wunused-parameter warnings in Unwind-wasm.c llvm/llvm-project#125412 removed parameter names to suppress -Wunused-parameter in their own build system, but this causes these errors instead for us:
      ../../../system/lib/libunwind/src/Unwind-wasm.c:105:62: error: omitting the parameter name in a function definition is a C23 extension [-Werror,-Wc23-extensions]
        105 | _LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t) {}
            |
    This suppresses the warnings. More details in the commit message.

llvm/llvm-project#125412 removed parameter names
to suppress `-Wunused-parameter` in their own build system. As a result
now we have this error:
```console
../../../system/lib/libunwind/src/Unwind-wasm.c:105:62: error: omitting the parameter name in a function definition is a C23 extension [-Werror,-Wc23-extensions]
  105 | _LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t) {}
      |
```

We have three ways to fix it?
1. Re-add parameter names. But this will later clash with
   llvm/llvm-project#125412.
2. Add `-std=c23` to the cflags. But this only applies to .c files and
   our `get_cflags` function in `system_libs.py` doesn't take a file
   name so we can't apply different cflags depending on the file
   extensions. While it's possible to add the filename paramater to
   `get_cflags`, it is a bigger refactoring.
3. Suppress the warning using `-Wno-c23-extension`.

This does 3, which is the quickest. But eventually we may need to change
what llvm/llvm-project#125412 did.
@aheejin aheejin requested a review from sbc100 January 3, 2026 09:35
@sbc100
Copy link
Collaborator

sbc100 commented Jan 3, 2026

Does upstream build with std=c23?

@aheejin
Copy link
Member Author

aheejin commented Jan 3, 2026

It does, but libunwind has both .c and .cpp files so we can't unilaterally build them with -std=c23. So we need a mechanism in system_libs.py to give different cflags depending on file extensions. So we need something like #26037. Do you think that's better?

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