Skip to content

Fix null argument errors - #10

Closed
aheejin wants to merge 1 commit into
emscripten-ports:masterfrom
aheejin:fix_nonnull
Closed

aheejin wants to merge 1 commit into
emscripten-ports:masterfrom
aheejin:fix_nonnull

Conversation

@aheejin

@aheejin aheejin commented Jan 10, 2026

Copy link
Copy Markdown

As of LLVM 21 (llvm/llvm-project#122790), libcxx's std::basic_string's constructor is marked as _Nonnull, so we can't pass NULLs here. Comiling this with LLVM 21's libcxx errors out with:

../emscripten/cache/ports/regal/regal-version_7/src/boost/boost/print/string_list.hpp:281:46: error:
      null passed to a callee that requires a non-null argument
      [-Werror,-Wnonnull]
  281 |   PushBack(*this).assign(string ? string : T(NULL));
      |                                              ^~~~
../emscripten/cache/sysroot/include/unistd.h:33:14: note:
      expanded from macro 'NULL'
   33 | #define NULL 0L

Suppressing this error with -Wno-nonnull would make this compile, but that can result in runtime errors.

As of LLVM 21 (llvm/llvm-project#122790),
libcxx's `std::basic_string`'s constructor is marked as `_Nonnull`, so
we can't pass `NULL`s here. Comiling this with LLVM 21's libcxx errors
out with:
```console
../emscripten/cache/ports/regal/regal-version_7/src/boost/boost/print/string_list.hpp:281:46: error:
      null passed to a callee that requires a non-null argument
      [-Werror,-Wnonnull]
  281 |   PushBack(*this).assign(string ? string : T(NULL));
      |                                              ^~~~
../emscripten/cache/sysroot/include/unistd.h:33:14: note:
      expanded from macro 'NULL'
   33 | #define NULL 0L
```

Suppressing this error with `-Wno-nonnull` would make this compile, but
that can result in runtime errors.
@aheejin

aheejin commented Jan 10, 2026

Copy link
Copy Markdown
Author

@sbc100

@sbc100

sbc100 commented Jan 10, 2026

Copy link
Copy Markdown

I think i'd rather leave this legacy third party codebase alone and suppress the error instead. I don't think we want to get into the business of maintaining this code.

@sbc100

sbc100 commented Jan 10, 2026

Copy link
Copy Markdown

Looks like this is even worse and we have copy of boost somehow embedded here in the regel repo?

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