Re: add __attribute__((noreturn)) to suppress a waring

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: add __attribute__((noreturn)) to suppress a waring
Date: 2011-01-24 15:14:42
Message-ID: 6210.1295882082@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> On 24.01.2011 03:42, Itagaki Takahiro wrote:
>> To suppress it, I'm thinking to add noreturn to die_horribly().
>> Any objections? Another solution might be adding a dummy assignment
>> after calls of die_horribly().

> I added a dummy assignment, that's how we've handled this before in
> pg_dump.

We generally do *not* want to depend on noreturn, because it will not
suppress similar warnings in non-gcc compilers. Just add a dummy
initialization, or reorganize the code to avoid the problem.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2011-01-24 15:33:29 Re: Include WAL in base backup
Previous Message Robert Haas 2011-01-24 14:58:01 Re: gist README