littlekernel / lk

LK embedded kernel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add -fcheck-new to c++ flags

travisg opened this issue · comments

Depending on when it was added to gcc and/or if clang supports it, should add this to the c++ flags since its more realistic that heap allocations can fail in an embedded environment.

FWIW the latest LLVM release, 14.0.0, does not support it. Although someone should really add it to clang so that standard new could be easier used in embedded programming.

Agreed. Bummer they don't. As it is, there are a handful of places in LK that use new and then test for null and indeed it does not actually result in any real test. Probably worth adding even if it's not properly supported in clang.

Supported since LLVM 17 (llvm/llvm-project@52c8f0b)