git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 0/3] Fix LLP64 `(size_t)1` compatibility VS C4334 warnings

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 1, 2021, 22:49 UTC
Message-ID
<xmqq5ys8ym8s.fsf@gitster.g>
In-Reply-To
<20211201002902.1042-1-philipoakley@iee.email>
Philip Oakley <philipoakley@iee.email> writes:
Show 24 quoted lines
> Since V1 (gitster/po/size-t-for-vs)
> https://lore.kernel.org/git/20211126113614.709-1-philipoakley@iee.email/
>
> Former patch 1/4 was dropped as it was already in Junio's tree.
>
> Patch 1/3 corrects my spelling mistake.
>
> Patch 2/3 has added extra spacing around the << operator as suggested by
> Stollee[1].
>
> Patch 3/3 removes the superceded commit message comment regarding
> backporting the patch onto maint.
>
> The Visual Studio MSVC compilation reports a number of C4334 "was 64-bit
> shift intended" size mismatch warnings. In most of these cases a size_t
> is ANDed (masked) with a bit shift of 1, or 1U. On LLP64 systems the unity
> value is 32 bits, while size_t is 64 bits. 
>
> The fix is to upcast the unity value to size_t.   
>
> The first [dropped] patch had been reported [2] by René Scharfe as an extra patch
> to the rs/mergesort series.
>
> These fixes clear all the current C4334 warnings.
Thanks.  Will queue; let's have it in 'next'.
Previous: Philip OakleyNext: Derrick Stolee
Message 5 of 6 in “Fix LLP64 `(size_t)1` compatibility VS C4334 warnings”
  1. 0/3 Fix LLP64 `(size_t)1` compatibility VS C4334 warningsPhilip Oakley, Dec 1, 2021
  2. 1/3 repack.c: LLP64 compatibility, upcast unity for left shiftPhilip Oakley, Dec 1, 2021
  3. 2/3 diffcore-delta.c: LLP64 compatibility, upcast unity for left shiftPhilip Oakley, Dec 1, 2021
  4. 3/3 object-file.c: LLP64 compatibility, upcast unity for left shiftPhilip Oakley, Dec 1, 2021
  5. Junio C HamanoDec 1, 2021
  6. Derrick StoleeDec 2, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.