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
Derrick Stolee <stolee@gmail.com>
Date
Dec 2, 2021, 20:56 UTC
Message-ID
<cbcdcad7-16c5-b14d-5edc-5c91909b13e2@gmail.com>
In-Reply-To
<xmqq5ys8ym8s.fsf@gitster.g>
On 12/1/2021 5:49 PM, Junio C Hamano wrote:
Show 28 quoted lines
> Philip Oakley <philipoakley@iee.email> writes:
> 
>> 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'.
I agree. This version is excellent.
-Stolee
 
Previous: Junio C Hamano
Message 6 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.