Re: [PATCH 00/37] removal of some c++ keywords
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jan 31, 2018, 01:05 UTC
- Message-ID
- <CACsJy8A=wLAY_Jmw-DRd_R0i-SW0qB-d9m13GohfTk16DY2ejg@mail.gmail.com>
- In-Reply-To
- <CAGZ79kZNB=3fXOeJwhXGqyBi3mKmE-9nmM-ooXJOzy5OcYaoqQ@mail.gmail.com>
On Wed, Jan 31, 2018 at 7:57 AM, Stefan Beller <sbeller@google.com> wrote:
Show 5 quoted lines
>> There's also C99 designator in builtin/clean.c (I thought we avoided >> C99, I can start using this specific feature more now :D) > > That was a test balloon? See 512f41cfac > (clean.c: use designated initializer, 2017-07-14)
Aww.. I thought it was in there since forever and it should be safe to use now...
Show 6 quoted lines
> One of the big advantages would be stricter type checking, such as > signed/unsigned confusion, that we occasionally have. > e.g. 61d36330b4 (prefer "!=" when checking read_in_full() > result, 2017-09-27) or what is referenced from there 561598cfcf > (read_pack_header: handle signed/unsigned comparison in read result, > 2017-09-13).
We can do that even with C (at least with gcc and I guess clang as well). The problem is it looks so bad right now that I have to turn it off with -Wno-sign-compare
> The bugs resulting in these patches could have been caught more easily > with C++ checking IMHO.
-- Duy