Re: integer overflow in reloption.h

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: integer overflow in reloption.h
Date: 2009-05-24 22:23:23
Message-ID: 12827.1243203803@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
> The problem is on the following lines

> typedef enum relopt_kind
> {
> ...
> RELOPT_KIND_MAX = (1 << 31)
> }

> enum is int datatype and 1 << 31 == -2147483648. It is reason why
> compiler (sun studio) complains.

> Is possible to change it to 1 << 30 to stop compiler generates noise?

Yeah, but we also have to fix the code that uses it. Done.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message pgsql 2009-05-24 22:41:17 WAL archive, warm backup and read-only slave
Previous Message Gevik Babakhani 2009-05-24 22:17:35 Re: pg_class and enum types