On 28-07-22, 11:11, Kent Gibson wrote:
The comment is:
// SAFETY: The string is guaranteed to be valid here.
and that is whether there a NULL check or not, so it isn't clear what the source of the guarantee is. I would prefer:
// SAFETY: The string is guaranteed to be valid by the C API.
I believe this is what we settled with now. I will make updates accordingly.
and updating the C header to explicitly state it returns a valid pointer. It currently says "Pointer to a human-readable string" which could be taken to mean valid, but making it "Valid pointer to..." would more clearly place the onus of it actually being valid on the C library.
I will let you guys handle the C API :)