Warning in new GIN code

Started by Tom Lanealmost 12 years ago2 messages
#1Tom Lane
tgl@sss.pgh.pa.us

The rather ancient gcc on my HPUX box is complaining thusly about HEAD:

ginbtree.c: In function `ginPlaceToPage':
ginbtree.c:602: warning: control reaches end of non-void function

I would imagine this would happen on any compiler that doesn't recognize
the hint about elog(ERROR) not returning. Could we stick a dummy return
at the end?

	}
	else
+	{
		elog(ERROR, "unknown return code from GIN placeToPage method: %d", rc);
+		return false;  /* keep compiler quiet */
+	}
}

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#2Heikki Linnakangas
hlinnakangas@vmware.com
In reply to: Tom Lane (#1)
Re: Warning in new GIN code

On 01/23/2014 08:41 PM, Tom Lane wrote:

The rather ancient gcc on my HPUX box is complaining thusly about HEAD:

ginbtree.c: In function `ginPlaceToPage':
ginbtree.c:602: warning: control reaches end of non-void function

I would imagine this would happen on any compiler that doesn't recognize
the hint about elog(ERROR) not returning. Could we stick a dummy return
at the end?

}
else
+	{
elog(ERROR, "unknown return code from GIN placeToPage method: %d", rc);
+		return false;  /* keep compiler quiet */
+	}
}

Fixed, thanks.

- Heikki

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers