Am 30.01.2017 um 16:39 schrieb Johannes Schindelin:
Hi René,

On Sat, 28 Jan 2017, René Scharfe wrote:

Add a macro for exchanging the values of variables.  It allows users to
avoid repetition and takes care of the temporary variable for them.  It
also makes sure that the storage sizes of its two parameters are the
same.  Its memcpy(1) calls are optimized away by current compilers.

How certain are we that "current compilers" optimize that away? And about
which "current compilers" are we talking? GCC? GCC 6? Clang? Clang 3?
Clang 3.8.*? Visual C 2005+?

GCC 4.4.7 and clang 3.2 on x86-64 compile the macro to the same object code as a manual swap ; see https://godbolt.org/g/F4b9M9. Both were released 2012. That website doesn't offer Visual C(++), but since you added the original macro in e5a94313c0 ("Teach git-apply about '-R'", 2006) I guess we have that part covered. ;)

René

Reply via email to