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

Поиск
Список
Период
Сортировка
От Christian Kruse
Тема Suspicion of a compiler bug in clang: using ternary operator in ereport()
Дата
Msg-id 20140128154307.GC24091@defunct.ch
обсуждение исходный текст
Ответы 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()  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Suspicion of a compiler bug in clang: using ternary operator in ereport()  (Christian Kruse <christian@2ndQuadrant.com>)
Список pgsql-hackers
Hi,

just a word of warning: it seems as if there is compiler bug in clang
regarding the ternary operator when used in ereport(). While working
on a patch I found that this code:
    ereport(FATAL,            (errmsg("could not map anonymous shared memory: %m"),             (errno == ENOMEM) ?
       errhint("This error usually means that PostgreSQL's request "                     "for a shared memory segment
exceededavailable memory "                     "or swap space. To reduce the request size (currently "
  "%zu bytes), reduce PostgreSQL's shared memory usage, "                     "perhaps by reducing shared_buffers or "
                  "max_connections.",                     *size) : 0)); 

did not emit a errhint when using clang, although errno == ENOMEM was
true. The same code works with gcc. I used the same data dir, so
config was exactly the same, too.

I reported this bug at clang.org:

<http://llvm.org/bugs/show_bug.cgi?id=18644>

Best regards,

-- Christian Kruse               http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Union-ifying RangeTblEntry
Следующее
От: Tom Lane
Дата:
Сообщение: Re: proposal: hide application_name from other users