Re: [PATCH] GSoC Micoproject: Hunt down signed int flags
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Feb 22, 2016, 09:32 UTC
- Message-ID
- <CACsJy8CbGY2BNF=VYtJFReVTycae18bdkqRhmVQi76COvm5f0w@mail.gmail.com>
- In-Reply-To
- <1456053189-5221-1-git-send-email-sauravsachidanand@gmail.com>
On Sun, Feb 21, 2016 at 6:13 PM, Saurav Sachidanand <sauravsachidanand@gmail.com> wrote:
> This is patch is for a suggested micro project for GSoC 2016; namely, > that of searching for a field of a struct that is of signed integral > type and used as a collection of multiple bits, and converting it to > an unsigned type if the MSB isn’t used in any special way.
if you use gcc, you can try to build git with -Wsign-conversion (i.e. "make CFLAGS=-Wsign-conversion") with and without your patch then see if there are any new warnings. I only checked dir.c and attr.c, there were 4 new warnings. From a quick look, I think gcc was correct, you just need to convert some more "int" to unsigned int" to prevent implicit conversion.
-- Duy