As for static strings... I think it'd be pretty hard to convince people that
strcpy(err->message, "out of memory");
static const char oom[] = "out of memory"; static_assert(sizeof(err->message) >= sizeof(oom)); memcpy(err->message, oom, sizeof(oom));
(That said, I personally prefer to use asprintf/snprintf even for static strings, for consistency's sake)
As for static strings... I think it'd be pretty hard to convince people that
is somehow much worse than especially if "err->message" is very long.(That said, I personally prefer to use asprintf/snprintf even for static strings, for consistency's sake)