target: Use ERR_CAST inlined function