Re: New-ish warning in refs.c with GCC (at least 11.2) under -O3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> +	/*
> +	 * Should be a noop per the ALLOWED_FLAGS check above, but this
> +	 * is necessary to work around a problem with some versions of
> +	 * "gcc -O3 -Wnonnull", which otherwise thinks that you can have the
> +	 * flag set with a NULL new_oid.
> +	 */
> +	flags &= ~REF_HAVE_OLD | REF_HAVE_NEW;

Are you missing parentheses around ~(OLD|NEW)?

>  	flags |= (new_oid ? REF_HAVE_NEW : 0) | (old_oid ? REF_HAVE_OLD : 0);
>  
>  	ref_transaction_add_update(transaction, refname, flags,
>
> I do find it interesting that gcc really _is_ convinced that those flags
> can be set coming in, since clearing them makes the problem go away.
> ...
> Reading over the code, it all looks OK. And that size is...weirdly huge.

The original bug is really annoying and this looks even worse.
Hopefully it won't come down from experimental to more stable tracks
before they are corrected.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux