Is the pointer returned by the following function valid?
const char * bool2str( bool flg ) { return flg ? \"Yes\" : \"No\"; }
It works
This code is perfectly valid and conformant. The only "gotcha" would be to ensure that the caller doesn't try to free the string.