printf("%lf",...) isn't actually portable

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Date: 2018-05-19T22:31:54Z
Lists: pgsql-hackers

Attachments

I noticed while poking at the recent ecpg unpleasantness that some
of my older critters were warning about use of %lf conversions in
printf.  Looking into it, I find that current POSIX says the "l"
is a no-op, while SUSv2 says it's undefined.  I think this usage
got into our code as a result of people making false analogies
between scanf and printf conversions.

I think we should just switch these to plain %f, as per attached.

			regards, tom lane

Commits

  1. printf("%lf") is not portable, so omit the "l".