Re: [PATCH] wrapper: avoid UB in macOS

2019-06-19 Thread Junio C Hamano
Carlo Marcelo Arenas Belón writes: > 0620b39b3b ("compat: add a mkstemps() compatibility function", 2009-05-31) > included a function based on code from libiberty which would result in > undefined behaviour in platforms where timeval's tv_usec is a 32-bit signed > type as shown by: > > wrapper.c

[PATCH] wrapper: avoid UB in macOS

2019-06-16 Thread Carlo Marcelo Arenas Belón
0620b39b3b ("compat: add a mkstemps() compatibility function", 2009-05-31) included a function based on code from libiberty which would result in undefined behaviour in platforms where timeval's tv_usec is a 32-bit signed type as shown by: wrapper.c:505:31: runtime error: left shift of 594546 by 1