Re: [PATCH] refs: make sure we never pass NULL to hashcpy

2017-09-08 Thread Junio C Hamano
Michael Haggerty writes: > So `ref_transaction_update()` *does* need to set or clear the `HAVE_NEW` > and `HAVE_OLD` bits as I sketched, to impedance-match between the two > conventions. OK, so ignoring HAVE_NEW/HAVE_OLD bits that the callers of ref_transaction_update()

Re: [PATCH] refs: make sure we never pass NULL to hashcpy

2017-09-08 Thread Michael Haggerty
On 09/08/2017 02:46 AM, Junio C Hamano wrote: > Michael Haggerty writes: > >> I did just realize one thing: `ref_transaction_update()` takes `flags` >> as an argument and alters it using >> >>> flags |= (new_sha1 ? REF_HAVE_NEW : 0) | (old_sha1 ? REF_HAVE_OLD : >>>

Re: [PATCH] refs: make sure we never pass NULL to hashcpy

2017-09-07 Thread Junio C Hamano
Michael Haggerty writes: > I did just realize one thing: `ref_transaction_update()` takes `flags` > as an argument and alters it using > >> flags |= (new_sha1 ? REF_HAVE_NEW : 0) | (old_sha1 ? REF_HAVE_OLD : >> 0); > > Perhaps gcc is *more* intelligent than we give

Re: [PATCH] refs: make sure we never pass NULL to hashcpy

2017-09-07 Thread Thomas Gummerer
On 09/07, Michael Haggerty wrote: > On Wed, Sep 6, 2017 at 3:26 AM, Junio C Hamano wrote: > > Thomas Gummerer writes: > > > >> gcc on arch linux (version 7.1.1) warns that a NULL argument is passed > >> as the second parameter of memcpy. > >> [...] > > >

Re: [PATCH] refs: make sure we never pass NULL to hashcpy

2017-09-07 Thread Michael Haggerty
On Wed, Sep 6, 2017 at 3:26 AM, Junio C Hamano wrote: > Thomas Gummerer writes: > >> gcc on arch linux (version 7.1.1) warns that a NULL argument is passed >> as the second parameter of memcpy. >> [...] > > It is hugely annoying to see a

Re: [PATCH] refs: make sure we never pass NULL to hashcpy

2017-09-06 Thread Thomas Gummerer
On Wed, Sep 6, 2017 at 2:26 AM, Junio C Hamano wrote: > Thomas Gummerer writes: > >> gcc on arch linux (version 7.1.1) warns that a NULL argument is passed >> as the second parameter of memcpy. >> >> In file included from refs.c:5:0: >> refs.c: In

Re: [PATCH] refs: make sure we never pass NULL to hashcpy

2017-09-05 Thread Junio C Hamano
Thomas Gummerer writes: > gcc on arch linux (version 7.1.1) warns that a NULL argument is passed > as the second parameter of memcpy. > > In file included from refs.c:5:0: > refs.c: In function ‘ref_transaction_verify’: > cache.h:948:2: error: argument 2 null where non-null

[PATCH] refs: make sure we never pass NULL to hashcpy

2017-09-04 Thread Thomas Gummerer
gcc on arch linux (version 7.1.1) warns that a NULL argument is passed as the second parameter of memcpy. In file included from refs.c:5:0: refs.c: In function ‘ref_transaction_verify’: cache.h:948:2: error: argument 2 null where non-null expected [-Werror=nonnull] memcpy(sha_dst, sha_src,