Fix compiler warnings in Cube Extension

Started by David Rowleyover 10 years ago3 messageshackers
Jump to latest
#1David Rowley
dgrowleyml@gmail.com

Hi,

My compiler is complaining about cube_coord() and cube_coord_llur() not
returning a value on all code paths. On looking at this I noticed that
this is happening due the pattern used is not quite aligned with other
code, as normally we do:

if (<error condition>)
ereport(<some error>);

do stuff;
PG_RETURN_....(value);

I've rearranged the code to be aligned more with what's normal. In passing
I also adding some missing and removed some unneeded parenthesis, and also
adjusted some white space.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachments:

cube_warning_fix.patchapplication/octet-stream; name=cube_warning_fix.patchDownload+23-26
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: David Rowley (#1)
Re: Fix compiler warnings in Cube Extension

David Rowley <david.rowley@2ndquadrant.com> writes:

My compiler is complaining about cube_coord() and cube_coord_llur() not
returning a value on all code paths.

Yeah, looking at that code, this would be expected from any compiler
that doesn't know that ereport() doesn't return. On it now. The
documentation aspect of that commit leaves much to be desired as well.

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

#3David Rowley
dgrowleyml@gmail.com
In reply to: Tom Lane (#2)
Re: Fix compiler warnings in Cube Extension

On 29 December 2015 at 07:38, Tom Lane <tgl@sss.pgh.pa.us> wrote:

David Rowley <david.rowley@2ndquadrant.com> writes:

My compiler is complaining about cube_coord() and cube_coord_llur() not
returning a value on all code paths.

Yeah, looking at that code, this would be expected from any compiler
that doesn't know that ereport() doesn't return. On it now. The
documentation aspect of that commit leaves much to be desired as well.

Great. Thanks for committing.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services