Re: Suspicion of a compiler bug in clang: using ternary operator in ereport()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Suspicion of a compiler bug in clang: using ternary operator in ereport()
Дата
Msg-id 4904.1390943951@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Suspicion of a compiler bug in clang: using ternary operator in ereport()  (Christian Kruse <christian@2ndQuadrant.com>)
Ответы Re: Suspicion of a compiler bug in clang: using ternary operator in ereport()  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
Christian Kruse <christian@2ndQuadrant.com> writes:
> According to http://llvm.org/bugs/show_bug.cgi?id=18644#c5 this is not
> a compiler bug but a difference between gcc and clang. Clang seems to
> use a left-to-right order of evaluation while gcc uses a right-to-left
> order of evaluation. So if errmsg changes errno this would lead to
> errno == ENOMEM evaluated to false.

Oh!  Yeah, that is our own bug then.

> Should we work on this issue?

Absolutely.  Probably best to save errno into a local just before the
ereport.
        regards, tom lane



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

Предыдущее
От: Christian Kruse
Дата:
Сообщение: Re: Suspicion of a compiler bug in clang: using ternary operator in ereport()
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Patch: regexp_matches variant returning an array of matching positions