Re: [HACKERS] "left shift of negative value" warnings

2017-04-10 Thread Markus Nullmeier
On 10/04/17 22:19, Andres Freund wrote: > I guess the motivation is that it's not entirely clear what happens with > the sign bit, when shifting. Indeed, certain one's complement CPUs even "outlived" C99 by a small margin, as it were:

Re: [HACKERS] "left shift of negative value" warnings

2017-04-10 Thread Andres Freund
On 2017-04-10 15:25:57 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2017-04-09 19:20:27 -0400, Tom Lane wrote: > >> As I read that, it's only "undefined" if overflow would occur (ie > >> the sign bit would change). Your compiler is being a useless annoying > >>

Re: [HACKERS] "left shift of negative value" warnings

2017-04-10 Thread Tom Lane
Andres Freund writes: > On 2017-04-09 19:20:27 -0400, Tom Lane wrote: >> As I read that, it's only "undefined" if overflow would occur (ie >> the sign bit would change). Your compiler is being a useless annoying >> nanny, but that seems to be the in thing for compiler authors

Re: [HACKERS] "left shift of negative value" warnings

2017-04-10 Thread Andres Freund
On 2017-04-09 19:20:27 -0400, Tom Lane wrote: > Andres Freund writes: > > For a while I've been getting warnings like > > /home/andres/src/postgresql/src/backend/utils/adt/inet_cidr_ntop.c: In > > function ‘inet_cidr_ntop_ipv6’: > >

Re: [HACKERS] "left shift of negative value" warnings

2017-04-09 Thread Tom Lane
Andres Freund writes: > For a while I've been getting warnings like > /home/andres/src/postgresql/src/backend/utils/adt/inet_cidr_ntop.c: In > function ‘inet_cidr_ntop_ipv6’: > /home/andres/src/postgresql/src/backend/utils/adt/inet_cidr_ntop.c:205:11: > warning: left shift