]> granicus.if.org Git - postgresql/commit
printf("%lf") is not portable, so omit the "l".
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 20 May 2018 15:40:54 +0000 (11:40 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 20 May 2018 15:40:54 +0000 (11:40 -0400)
commit29a4db65fbb752b2c0b212f331eb375532a7b9d9
tree58b6874c29062525a416cab74a267f57e84d04c3
parent7329af6b9ebf9c6167366870cb9304410b4617fd
printf("%lf") is not portable, so omit the "l".

The "l" (ell) width spec means something in the corresponding scanf usage,
but not here.  While modern POSIX says that applying "l" to "f" and other
floating format specs is a no-op, SUSv2 says it's undefined.  Buildfarm
experience says that some old compilers emit warnings about it, and at
least one old stdio implementation (mingw's "ANSI" option) actually
produces wrong answers and/or crashes.

Discussion: https://postgr.es/m/21670.1526769114@sss.pgh.pa.us
Discussion: https://postgr.es/m/c085e1da-0d64-1c15-242d-c921f32e0d5c@dunslane.net
doc/src/sgml/ecpg.sgml
src/interfaces/ecpg/test/compat_informix/sqlda.pgc
src/interfaces/ecpg/test/expected/compat_informix-sqlda.c
src/interfaces/ecpg/test/expected/preproc-outofscope.c
src/interfaces/ecpg/test/expected/sql-sqlda.c
src/interfaces/ecpg/test/preproc/outofscope.pgc
src/interfaces/ecpg/test/sql/sqlda.pgc