emscripten-core / emscripten-core/emscripten

Should we ship NDEBUG (no asserts) versions of system libraries

Open
#15,628 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Our use of NDEBUG to disable asserts in system libraries is inconsistent today:

libcxx: Always define NDEBUG
libunwind: Always define NDEBUG
libmalloc: Defines `-debug` variant which doesn't define NDEBUG
libstubs: Defines `-debug` variant which doesn't define NDEBUG
libstandalonewasm: Always define NDEBUG

All other libraries do not define NDEBUG which means they include assertions. This includes libc, compiler-rt and libwasmfs.

For most of libc its not a huge deal since musl doesn't do at lot of asserting, but where have modified musl (for example in the pthread code we do have a bunch of asserts).

I guess we should probably define `-debug` versions of all libraries and link them when `ASSERTIONS` is enabled?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.