Re: Suspicion of a compiler bug in clang: using ternary operator in ereport() - Mailing list pgsql-hackers

From Christian Kruse
Subject Re: Suspicion of a compiler bug in clang: using ternary operator in ereport()
Date
Msg-id 20140128155722.GD24091@defunct.ch
Whole thread Raw
In response to Suspicion of a compiler bug in clang: using ternary operator in ereport()  (Christian Kruse <christian@2ndQuadrant.com>)
List 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'srequest "         "for a shared memory segment exceeded available memory "         "or swap space. To
reducethe request size (currently "         "%zu bytes), reduce PostgreSQL's shared memory usage, "         "perhaps by
reducingshared_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


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: proposal: hide application_name from other users
Next
From: Tom Lane
Date:
Subject: Re: alternative back-end block formats