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

From: Christian Kruse <christian(at)2ndQuadrant(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Suspicion of a compiler bug in clang: using ternary operator in ereport()
Date: 2014-01-28 15:57:22
Message-ID: 20140128155722.GD24091@defunct.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

when I remove the errno comparison and use a 1 it works:

ereport(FATAL,
(errmsg("could not map anonymous shared memory: %m"),
1 ?
errhint("This error usually means that PostgreSQL's request "
"for a shared memory segment exceeded available 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));

Same if I use an if(errno == ENOMEM) instead of the ternary operator.

Best regards,

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-01-28 16:00:23 Re: alternative back-end block formats
Previous Message Andres Freund 2014-01-28 15:52:40 Re: proposal: hide application_name from other users