On Sep 10, 2025, at 6:10 AM, Lénárd Szolnoki via Std-Proposals <std-proposals@lists.isocpp.org> wrote:

If a C library has something like:

void foo(_BitInt(16) x);

, then it can plausibly have documentation and example code with foo(42) or foo(some_int) in it. It can be confusing and add friction when the same C library has subtly different interfaces from C and from C++.


Good example!

But I see it from the other side of the the fence.  I think it would be a good thing if foo(some_int) did not compile when switching from C to C++.  I.e. switch from C to C++ and you can catch some run-time UB at compile-time.  That looks like a good safety feature to me.

foo(42) is another matter.  I’d love for the compiler to be smart enough to recognize that the compile-time value is safe to narrow.

Howard