Re: [PATCH v2] block-sha1: remove use of assembly
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Mar 10, 2022, 02:34 UTC
- Message-ID
- <Yilj0qMqk5eC4TKo@nand.local>
- In-Reply-To
- <220310.86cziulls6.gmgdl@evledraar.gmail.com>
On Thu, Mar 10, 2022 at 12:52:31AM +0100, Ævar Arnfjörð Bjarmason wrote:
Show 15 quoted lines
> >> I suspect it has the same problem. My inclination is to just remove it, > >> because my guess is that the compiler has gotten smarter between 2009 > >> and now. > > > > Almost certainly. I don't have a machine to test it on, either, but I > > would be shocked if `make BLK_SHA=YesPlease DEVELOPER=1` worked on > > master today on an arm machine. > > Why is that? The -pedantic error is specifically about > "gnu-statement-expression", i.e. the bracket syntax, not the inline > assembly per-se. > > The ARM assembly isn't using that, and we have other code __asm__ code > compiled with -pedantic. E.g. I get the __asm__ in "compat/bswap.h" by > default, and it passes -pedantic (the code starting around line 38).
You're right, I had this completely mixed up in my mind. In GitHub's fork there is a spot I have been working near for the past couple of days where there is inline assembly right below a statement expression.
The statement expression is what causes the -pedantic builds to fail, not the inline __asm__. Indeed, if you just stick a memory barrier anywhere in Git's codebase, we'll still compile under the DEVELOPER=1 builds.
> Isn't that __extension__ only needed *if* it warns under -pedantic, > which AFAICT doesn't apply to all uses of __asm__ (but your compiler > version etc. may be different...).
Yes, disregard that last suggestion :-).
Thanks, Taylor