Merge branch 'jk/refs-g11-workaround'
Workaround for a false-alarm by gcc-11 * jk/refs-g11-workaround: refs: work around gcc-11 warning with REF_HAVE_NEW
This commit is contained in:
7
refs.c
7
refs.c
@ -1094,6 +1094,13 @@ int ref_transaction_update(struct ref_transaction *transaction,
|
|||||||
if (flags & ~REF_TRANSACTION_UPDATE_ALLOWED_FLAGS)
|
if (flags & ~REF_TRANSACTION_UPDATE_ALLOWED_FLAGS)
|
||||||
BUG("illegal flags 0x%x passed to ref_transaction_update()", flags);
|
BUG("illegal flags 0x%x passed to ref_transaction_update()", flags);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Clear flags outside the allowed set; this should be a noop because
|
||||||
|
* of the BUG() check above, but it works around a -Wnonnull warning
|
||||||
|
* with some versions of "gcc -O3".
|
||||||
|
*/
|
||||||
|
flags &= REF_TRANSACTION_UPDATE_ALLOWED_FLAGS;
|
||||||
|
|
||||||
flags |= (new_oid ? REF_HAVE_NEW : 0) | (old_oid ? REF_HAVE_OLD : 0);
|
flags |= (new_oid ? REF_HAVE_NEW : 0) | (old_oid ? REF_HAVE_OLD : 0);
|
||||||
|
|
||||||
ref_transaction_add_update(transaction, refname, flags,
|
ref_transaction_add_update(transaction, refname, flags,
|
||||||
|
Reference in New Issue
Block a user