I'd like to write a function with a prototype like the following

```
void fun(Thing *one, Thing *two, Thing *ret);

```

I'd like to consider the fact that `ret` may or may not be aliased by `one` or `two`. This should be determined at runtime if needed, and the appropriate code called.

Is this a bad idea? Are there language semantics to have this?

EDIT: I haven't made clear that I don't want to test by hand like `if (one == ret || two == ret)` which naturally works but seems very verbose to me. Also, I don't want duplicated code for two almost identical cases (only the qualifier differs). I am more looking for what is idiomatically a good solution, and if there are any language semantics supporting such cases.