https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667
--- Comment #38 from Tim Ruffing <public at timruffing dot de> --- (In reply to Rich Felker from comment #36) > If you're happy with a branch, you could probably take restrict off the > arguments and do something like: > > if (src==dest) return; > const char *restrict src2 = src; > char *restrict dest2 = dest; > ... > I'm not saying that such an implementation will be a good idea, but just a remark: You could, in fact, keep restrict for the arguments in this case, because the object pointed to by src and dest is not accessed at all when src==dest. So this is correct code according to the standard. (The exact semantics of restrict are a bit involved...)