Re: Allowing printf("%m") only where it actually works

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Allowing printf("%m") only where it actually works
Date: 2018-10-09 00:47:16
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

So, circling back to the very beginning of this thread where I worried
about all the compile warnings we get on NetBSD-current, I'm pleased
to report that HEAD compiles warning-free so long as you define
PG_PRINTF_ATTRIBUTE to "__syslog__" rather than "gnu_printf".

So attached is a proposed patch to make configure check whether %m
works without a warning, and try "__syslog__" if "gnu_printf" does
not work for that. (I did it in that order so that if NetBSD get
their heads screwed back on straight and stop complaining about
perfectly GNU-compliant code, we'll go back to selecting "gnu_printf".)

Any objections?

regards, tom lane

Attachment Content-Type Size
try-__syslog__-format-archetype-when-needed.patch text/x-diff 5.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2018-10-09 00:49:44 Re: Partial index plan/cardinality costing
Previous Message Thomas Munro 2018-10-09 00:38:54 Re: DSM segment handle generation in background workers