Re: pgbench is broken on strict-C89 compilers

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: pgbench is broken on strict-C89 compilers
Дата
Msg-id 20140518055908.GT23662@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: pgbench is broken on strict-C89 compilers  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2014-05-18 00:36:34 -0400, Tom Lane wrote:
> Andres Freund <andres@2ndquadrant.com> writes:
> > On 2014-05-17 19:15:15 -0400, Tom Lane wrote:
> >> ... It appears to me that
> >> the compiler is within its rights to refuse a nonconstant expression
> >> for an inner initializer according to C89, though I don't see any such
> >> restriction in C99.
> 
> > Yea, I've complained about it in
> > http://www.postgresql.org/message-id/20140403152834.GG17307@awork2.anarazel.de
> 
> Ah.  I'd sort of ignored that patch because it didn't seem too relevant
> to the issues we were discussing at the time.

Well, I wanted to start a animal that quickly warns about the nameless
union stuff. That'd require a sensibly clean build.

> > That piece code is also confused about using static vs. const. For a lot
> > longer though...
> 
> Well, "static" is also a good thing here because it eliminates the need
> for runtime initialization of a function-local array variable.  But yeah,
> the code is way under-const-ified as well.

Well, const alone would do that too; without requiring checks on every
function invocation. The const variant should end up in the readonly
part of the binary...

> > I'd just duplicated the ddl structs. Seemed to be the least ugly thing I
> > could come up with. For from pretty tho.
> 
> It works, anyway.  If I don't think of something better, I'll do a bit
> more polishing and commit that tomorrow.

Ok, thanks.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Possible fix for occasional failures on castoroides etc
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: btree_gist macaddr valgrind woes