Re: pgsql: Add pg_noinline macro to c.h.

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Add pg_noinline macro to c.h.
Date: 2017-10-13 22:43:46
Message-ID: 20171013224346.x2jlstni2dexnuis@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On 2017-10-13 18:32:08 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > Add pg_noinline macro to c.h.
>
> I think you want this to be parenthesized so that pgindent doesn't
> go nuts when you use it. At least, that was the reason why
> pg_attribute_noreturn() has parens. Even if the current version
> of pgindent doesn't have that problem

The current pgindent actually generates *better* layout with pg_noinline
rather than pg_noinline(). The latter forces a linebreak both in
declarations and definitions like:

static pg_noinline()
HeapTuple SearchCatCacheMiss(CatCache *cache,

static pg_noinline()
HeapTuple
SearchCatCacheMiss(CatCache *cache,

One difference to pg_attribute_noreturn() is that for function
definitions - and noinline needs to be present there IME - you can't put
it after the parameter list.

> I would argue that consistency demands that you spell this pg_attribute_noinline().

Hm, I personally find inline vs pg_noinline more aesthetically pleasing.

Greetings,

Andres Freund

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Joe Conway 2017-10-13 23:07:38 pgsql: Add missing options to pg_regress help() output
Previous Message Tom Lane 2017-10-13 22:32:08 Re: pgsql: Add pg_noinline macro to c.h.