/kernel mode in MSVC cl.exe allows new despite specifying user must explicitly define the operator
04:41 22 Nov 2025

According to documentation, under /kernel mode:

You must explicitly define the new() or delete() operator. The compiler and runtime don't supply a default definition.

Yet, the following code compiles and runs fine without any error.

#include 

int main(){
    int* xyz = new int[10];
    std::cout<<"Hello!";
}

See godbolt link here: https://godbolt.org/z/96MTMcYeT

(Q1) Despite my not doing anything explicit regarding new(), why does the code compile correctly which seemingly goes against the official docs?

(Q2) In godbolt, is there a way to specify linker flags as opposed to just compile flags?

c++ kernel cl.exe compiler-explorer godbolt