integer overflow in reloption.h - Mailing list pgsql-hackers

From Zdenek Kotala
Subject integer overflow in reloption.h
Date
Msg-id 1243022922.1596.7.camel@localhost
Whole thread Raw
Responses Re: integer overflow in reloption.h
List pgsql-hackers
When I compile postgresql now I get following message:

"../../../src/include/access/reloptions.h", line 45: warning: integer
overflow detected: op "<<"


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?
Thanks Zdenek






pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [PATCH] 8.5 plpgsql change for named notation: treat word following AS keyword as label v2
Next
From: Greg Smith
Date:
Subject: Re: Revisiting default_statistics_target