Fix -Wcast-qual warnings in psql

Some platforms declare HIST_ENTRY.line as const char * (apparently
macOS and NetBSD libedit), but we cast that away using (char *) and
write into it.  To appease -Wcast-qual, change that cast to
unconstify().  But for other platforms where it is plain char * to
begin with, unconstify doesn't work because it doesn't allow casting a
non-const to a non-const.  So to make this work portably we first have
to cast to (const char *).  (Maybe we could make unconstify handle
this, but so far it is only required in this one place, so it might
not be worth it.)

Reported-by: Chao Li <[email protected]>
Discussion: 
https://www.postgresql.org/message-id/flat/70b86618-4038-4b19-8847-1a400d99d477%40eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5ff67951c46d304d5ac4cda62eb99d64cd292c8c

Modified Files
--------------
src/bin/psql/input.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Reply via email to