Skip to content

Fix -Wattribute-alias warnings in dlmalloc.c - #26934

Merged
sbc100 merged 3 commits into
emscripten-core:mainfrom
aheejin:attribute_alias
May 13, 2026
Merged

Fix -Wattribute-alias warnings in dlmalloc.c#26934
sbc100 merged 3 commits into
emscripten-core:mainfrom
aheejin:attribute_alias

Conversation

@aheejin

@aheejin aheejin commented May 13, 2026

Copy link
Copy Markdown
Member

llvm/llvm-project#195550 added -Wattribute-alias, which warns on type mismatches between an alias and its aliased function. This is currently failing on the waterfall: https://ci.chromium.org/ui/p/emscripten-releases/builders/try/linux/b8681947828444624337/overview

This fixes the warnings. I'm not sure if we treat this dlmalloc.c as a third party code we should not modify, in which case we can consider adding -Wno-attribute-alias in system_libs.py.

Fixes: #26936

llvm/llvm-project#195550 added
`-Wattribute-alias`, which warns on type mismatches between an alias and
its aliased function. This is currently failing on the waterfall:
https://ci.chromium.org/ui/p/emscripten-releases/builders/try/linux/b8681947828444624337/overview

This fixes the warnings. I'm not sure if we treat this `dlmalloc.c` as a
third party code we should not modify, in which case we can consider
adding `-Wno-attribute-alias` in `system_libs.py`.
@aheejin
aheejin requested review from sbc100 and tlively May 13, 2026 05:00
@sbc100

sbc100 commented May 13, 2026

Copy link
Copy Markdown
Collaborator

We do carry some patches to dlmalloc so if patching is the right thing to do we can do it.

Are the mismatches purely about const-ness here?

@aheejin

aheejin commented May 13, 2026

Copy link
Copy Markdown
Member Author

Those two cases are real mismatches I confirmed. One is not only the constness but the number of size_t arguments ((size_t) vs. (size_t, size_t)). I haven't checked other lines, but with this fix the file seems to build fine.

aheejin added 2 commits May 13, 2026 06:30
This is an automatic change generated by tools/maint/rebaseline_tests.py.

The following (7) test expectation files were updated by
running the tests with `--rebaseline`:

```
codesize/test_codesize_cxx_ctors1.json: 151949 => 151949 [+0 bytes / +0.00%]
codesize/test_codesize_cxx_ctors2.json: 151352 => 151352 [+0 bytes / +0.00%]
codesize/test_codesize_cxx_except.json: 195817 => 195817 [+0 bytes / +0.00%]
codesize/test_codesize_cxx_except_wasm.json: 167044 => 167044 [+0 bytes / +0.00%]
codesize/test_codesize_cxx_except_wasm_legacy.json: 164924 => 164924 [+0 bytes / +0.00%]
codesize/test_codesize_cxx_mangle.json: 262296 => 262296 [+0 bytes / +0.00%]
codesize/test_codesize_cxx_noexcept.json: 153965 => 153965 [+0 bytes / +0.00%]

Average change: +0.00% (+0.00% - +0.00%)
```
@sbc100
sbc100 merged commit f46e0d8 into emscripten-core:main May 13, 2026
30 checks passed
@aheejin
aheejin deleted the attribute_alias branch May 13, 2026 19:39
sbc100 pushed a commit that referenced this pull request May 13, 2026
This fails for the same reason as #26934.
llvm/llvm-project#195550 added
`-Wattribute-alias`, which warns on type mismatches between an alias and
its aliased function.

I ran `./embuilder build ALL` and confirmed there were no more
`-Wattribute-alias` errors.
akoeplinger pushed a commit to dotnet/emscripten that referenced this pull request Jun 14, 2026
llvm/llvm-project#195550 added
`-Wattribute-alias`, which warns on type mismatches between an alias and
its aliased function. This is currently failing on the waterfall:
https://ci.chromium.org/ui/p/emscripten-releases/builders/try/linux/b8681947828444624337/overview

This fixes the warnings. I'm not sure if we treat this `dlmalloc.c` as a
third party code we should not modify, in which case we can consider
adding `-Wno-attribute-alias` in `system_libs.py`.

Fixes: emscripten-core#26936
(cherry picked from commit f46e0d8)
akoeplinger pushed a commit to dotnet/emscripten that referenced this pull request Jun 14, 2026
This fails for the same reason as emscripten-core#26934.
llvm/llvm-project#195550 added
`-Wattribute-alias`, which warns on type mismatches between an alias and
its aliased function.

I ran `./embuilder build ALL` and confirmed there were no more
`-Wattribute-alias` errors.

(cherry picked from commit 89fc675)
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.

core0.test_dlmalloc_inline regression

2 participants