Re: [HACKERS] Size vs size_t
От | Tom Lane |
---|---|
Тема | Re: [HACKERS] Size vs size_t |
Дата | |
Msg-id | 26314.1489701611@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: [HACKERS] Size vs size_t (Andres Freund <andres@anarazel.de>) |
Список | pgsql-hackers |
Andres Freund <andres@anarazel.de> writes: > On 2017-03-16 17:24:17 -0400, Tom Lane wrote: >> The short answer to that is that "Size" predates the universal acceptance >> of size_t. If we were making these decisions today, or anytime since the >> early 2000s, we'd surely have just gone with size_t. But it wasn't a >> realistic option in the 90s. > Just out of curiosity I checked when we switched to backing Size with > size_t: > 1998 - 0ad5d2a3a886e72b429ea2b84bfcb36c0680f84d Yeah. We inherited the previous definition (as "unsigned int") from Berkeley. I wasn't involved then, of course, but I follow their reasoning perfectly because I remember fighting the same type of portability battles with libjpeg in the early 90s. "size_t" was invented by the ANSI C committee (hence, 1989 or 1990) and had only very haphazard penetration until the late 90s. If you wanted to write portable code you couldn't depend on it. regards, tom lane
В списке pgsql-hackers по дате отправления: