Re: signed vs. unsigned in plpy_procedure.c - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: signed vs. unsigned in plpy_procedure.c
Date
Msg-id 51D2E9A0.6000201@vmware.com
Whole thread Raw
In response to signed vs. unsigned in plpy_procedure.c  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
On 02.07.2013 13:39, Andres Freund wrote:
> src/postgresql/src/pl/plpython/plpy_procedure.c: In function ‘PLy_procedure_munge_source’:
> src/postgresql/src/pl/plpython/plpy_procedure.c:507:2: warning: comparison of unsigned expression>= 0 is always true
[-Wtype-limits]
>    Assert(plen>= 0&&  plen<  mlen);
>
> Which has a point, we assign sprintf()s result to a size_t and then
> check for a negative value. Which doesn't work.
>
> Obviously the impact is miniscule, but removing legitimate warnings is a
> good thing. Trivial patch attached.

Thanks, applied.

- Heikki



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [9.4 CF 1] The Commitfest Slacker List
Next
From: Robert Haas
Date:
Subject: Re: Large object + FREEZE?