Fixed #6009 (Detect type mismatch in printf-like function when type is returned)