Re: psql use of 'volatile'

Peter Eisentraut <e99re41@docs.uu.se>

From: Peter Eisentraut <e99re41@DoCS.UU.SE>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Date: 2000-06-29T16:36:48Z
Lists: pgsql-hackers
On Thu, 29 Jun 2000, Bruce Momjian wrote:

> Can someone explain why 'volatile' is used in psql/mainloop.c?

If you remove them then you get tons of warnings about variables possibly
getting clobbered. The reason is the longjmp business that's going on when
you press Control-C. (The fact that the variables would get clobbered is
not critical since they're reinitialized immediately anyway, but who am I
to argue with the compiler.)

-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden