Skip to content

Conversation

@google-yfyang
Copy link
Collaborator

This is to match llvm-libc's behavior when an invalid errno is specified.

When errno is specified as -1, for instance, the current behavior prints "Success". With this change, any invalid errno emits out "Unknown error %d".

@google-yfyang google-yfyang force-pushed the errno branch 4 times, most recently from 26b0edf to 6f0aa29 Compare November 11, 2025 16:54
Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

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

lgtm % nits

@sbc100
Copy link
Collaborator

sbc100 commented Nov 11, 2025

It looks this does come at a codesize cost. It is a very small one so maybe fine. Can you run ./tools/maint/rebaseline_tests.py

@google-yfyang
Copy link
Collaborator Author

It looks this does come at a codesize cost. It is a very small one so maybe fine. Can you run ./tools/maint/rebaseline_tests.py

Done.

"a.out.js": 245483,
"a.out.nodebug.wasm": 574056,
"total": 819539,
"a.out.nodebug.wasm": 573907,
Copy link
Collaborator

Choose a reason for hiding this comment

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

How did this one get smaller?? Strange.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

possibly heavy optimization takes the return "Unknown error" branch and avoids the more complicated
s = (char *)&errmsgstr + errmsgidx[e];?

@google-yfyang google-yfyang merged commit 545c29b into emscripten-core:main Nov 11, 2025
34 checks passed
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