Re: [HACKERS] Size vs size_t - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: [HACKERS] Size vs size_t
Date
Msg-id D8C0749C-54B4-4503-AAF8-53059C3E624F@yesql.se
Whole thread Raw
In response to Re: [HACKERS] Size vs size_t  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> On 16 Mar 2017, at 23:20, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Thomas Munro <thomas.munro@enterprisedb.com> writes:
>> Naive replacement in new files (present in master but not in 9.6) with
>> the attached script, followed by a couple of manual corrections where
>> Size was really an English word in a comment, gets the attached diff.
>
> In the case of mmgr/slab.c, a lot of those uses of Size probably
> correspond to instantiations of the MemoryContext APIs; so blindly
> changing them to "size_t" seems like a bit of a type violation
> (and might indeed draw warnings from pickier compilers).  Don't
> know if any of the other things you've identified here have similar
> entanglements.

While it might not be an issue that hits many developers, Size is also defined
on macOS in the MacTypes.h header so using CoreFoundation when hacking on macOS
port code will cause typedef redefinition errors.

Not really a case for or against, but another datapoint.

cheers ./daniel


pgsql-hackers by date:

Previous
From: Vitaly Burovoy
Date:
Subject: Re: [HACKERS] identity columns
Next
From: Heikki Linnakangas
Date:
Subject: [HACKERS] Re: [COMMITTERS] pgsql: Add TAP tests for password-basedauthentication methods.