Re: unconstify equivalent for volatile

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: unconstify equivalent for volatile
Дата
Msg-id 20190218163200.slspmu3b7n45sskf@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: unconstify equivalent for volatile  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

On 2019-02-18 10:43:50 -0500, Tom Lane wrote:
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> > I propose to add an equivalent to unconstify() for volatile.  When
> > working on this, I picked the name unvolatize() mostly as a joke, but it
> > appears it's a real word.  Other ideas?
> 
> Umm ... wouldn't this amount to papering over actual bugs?  I can
> think of legitimate reasons to cast away const, but casting away
> volatile seems pretty dangerous, and not something to encourage
> by making it notationally easy.

Most of those seem to be cases where volatile was just to make sigsetjmp
safe. There's plently legitimate cases where we need to cast volatile
away in those, e.g. because the variable needs to be passed to memcpy.

Greetings,

Andres Freund


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Use varargs macro for CACHEDEBUG
Следующее
От: Andres Freund
Дата:
Сообщение: Re: [Patch] pg_rewind: options to use restore_command fromrecovery.conf or command line