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

Re: validating signed/unsigned comparisons with Coccinelle, was Re: [PATCH 0/3] A couple of CI fixes regarding the built-in add --patch

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Aug 30, 2022, 15:22 UTC
Message-ID
<dc48ce59-530e-da74-93ad-9eb4a17e391c@gmail.com>
In-Reply-To
<p9p431r8-nq64-02sq-3049-n10rrn1o89o7@tzk.qr>
Hi Dscho
On 30/08/2022 15:19, Johannes Schindelin wrote:
Show 35 quoted lines
> Hi,
> 
> On Tue, 30 Aug 2022, Johannes Schindelin via GitGitGadget wrote:
> 
>> Note: This patch series is based on ds/github-actions-use-newer-ubuntu (but
>> probably applies cleanly even on maint) because I tried to develop a
>> semantic patch to fix similar issues in the code base. However, I've since
>> run into what looks like a bug in Coccinelle
>> [https://github.com/coccinelle/coccinelle/issues/284]. My latest version of
>> that semantic patch looks like this, but I stopped when running it on Git's
>> source code triggered the bug for 66 of Git's .c files:
>>
>> @@
>> type T = { unsigned int };
>> T:n b;
>> type S != { unsigned int, size_t };
>> S s;
>> binary operator o != { &&, || };
>> @@
>> -s o b
>> +s o (S)b
>>
>> @@
>> type T = { unsigned int };
>> T:n b;
>> type S != { unsigned int, size_t };
>> S s;
>> binary operator o != { &&, || };
>> @@
>> -b o s
>> +(S)b o s
> 
> The bug in Coccinelle is already fixed (are you impressed? I certainly
> am at the incredible speed and at the wonderful conversation I had!), and
> I verified with this semantic patch that our code is clean:

Wow that's fast, I wonder if they would be interested in fixing the parsing bug we found with Peff's UNUSED() series. It's good news that the patch does not find any other problems.

Best Wishes
Phillip
Show 31 quoted lines
> 
> -- snip --
> @@
> type T = { unsigned int };
> T:n b;
> type S != { unsigned int, size_t, float, double };
> S s;
> binary operator o != { &&, || };
> @@
>   s o
> -b
> +(S)b
> 
> @@
> type T = { unsigned int };
> T:n b;
> type S != { unsigned int, size_t, float, double };
> S s;
> binary operator o != { &&, || };
> @@
> -b
> +(S)b
>   o s
> -- snap --
> 
> I do not currently plan on integrating this into `contrib/coccinelle/`,
> though, because it will take a while until we can benefit from the fix in
> Git's CI/PR runs.
> 
> Ciao,
> Dscho
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 10 of 15 in “A couple of CI fixes regarding the built-in add --patch”
  1. 0/3 A couple of CI fixes regarding the built-in add --patchJohannes Schindelin via GitGitGadget, Aug 30, 2022
  2. 1/3 add -p: avoid ambiguous signed/unsigned comparisonJohannes Schindelin via GitGitGadget, Aug 30, 2022
  3. Junio C HamanoAug 30, 2022
  4. 2/3 t3701: test the built-in `add -i` regardless of NO_PERLJohannes Schindelin via GitGitGadget, Aug 30, 2022
  5. Jeff KingAug 30, 2022
  6. Johannes SchindelinAug 30, 2022
  7. Junio C HamanoAug 30, 2022
  8. 3/3 t6132(NO_PERL): do not run the scripted `add -p`Johannes Schindelin via GitGitGadget, Aug 30, 2022
  9. validating signed/unsigned comparisons with Coccinelle, was Re: [PATCH 0/3] A couple of CI fixes regarding the built-in add --patchJohannes Schindelin, Aug 30, 2022
  10. Phillip WoodAug 30, 2022
  11. Johannes SchindelinAug 30, 2022
  12. Junio C HamanoAug 30, 2022
  13. Junio C HamanoAug 30, 2022
  14. Jeff KingAug 30, 2022
  15. Phillip WoodAug 30, 2022

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.