Skip site navigation (1) Skip section navigation (2)

Re: Re: Cygwin PostgreSQL CVS Patch Question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jason Tishler <Jason(dot)Tishler(at)dothill(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-ports(at)postgresql(dot)org
Subject: Re: Re: Cygwin PostgreSQL CVS Patch Question
Date: 2001-01-09 23:37:31
Message-ID: 7665.979083451@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-ports
Jason Tishler <Jason(dot)Tishler(at)dothill(dot)com> writes:
>     extern int sys_nerr;
>     int main() {
>     int x = sys_nerr;
>     ; return 0; }

> The problem is gcc -O2 is being too smart, optimizing away the reference
> to sys_nerr.

Oh, that's nasty.  Try a test program like so:

	extern int sys_nerr;
	int my_nerr;
	int main() {
	my_nerr = sys_nerr;
	return 0; }

I don't think gcc will try to optimize away an assignment to a global
variable.

			regards, tom lane

In response to

Responses

pgsql-ports by date

Next:From: Jason TishlerDate: 2001-01-10 01:54:41
Subject: Re: Re: Cygwin PostgreSQL CVS Patch Question
Previous:From: Tom LaneDate: 2001-01-09 23:34:33
Subject: Re: Cygwin PostgreSQL CVS Patch Question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group