update errcode gen to cast as char* for c++ errs