On 2013-12-13 20:58:24 +1300, David Rowley wrote: > On Wed, Dec 11, 2013 at 1:11 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> This introduced a new compiler warning on the visual studios build: > d:\postgres\b\src\backend\utils\cache\relcache.c(3958): warning C4715: > 'RelationGetIndexAttrBitmap' : not all control paths return a value > [D:\Postgres\b\postgres.vcxproj] > > The attached patch fixes it.
I thought we'd managed to get elog(ERROR) properly annotated as noreturn on msvc as well?
It looks like this is down to the elog macro, where the elevel is being assigned to a variable elevel_ then we're only doing pg_unreachable(); if elevel_ >= ERROR. The compiler must not be confident enough to optimise out the if condition even though the elevel is not changed after it is set from the constant.