Re: removing some dead "keep compiler quiet" code

Lists: pgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: removing some dead "keep compiler quiet" code
Date: 2012-11-20 03:45:56
Message-ID: 1353383156.6670.25.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Since ereport() can now communicate to the compiler whether it returns
or not, a fair amount of "keep compiler quiet" code is dead. Since the
method that ereport() uses is not dependent on any compiler-specific
attributes, I think this code can just be removed. I propose the
attached patch.

Attachment Content-Type Size
pg-keep-compiler-quiet.patch text/x-patch 24.6 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: removing some dead "keep compiler quiet" code
Date: 2012-11-20 04:09:44
Message-ID: 25398.1353384584@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Since ereport() can now communicate to the compiler whether it returns
> or not, a fair amount of "keep compiler quiet" code is dead. Since the
> method that ereport() uses is not dependent on any compiler-specific
> attributes, I think this code can just be removed. I propose the
> attached patch.

Meh. This will only work if the compiler understands that abort()
doesn't return --- compilers that don't know that will start bleating
about uninitialized variables again. And the ones that do know it
will be able to throw away the dead code anyway.

I doubt this is a good idea.

regards, tom lane