Fix gdb.base/charset.exp with Clang
authorPedro Alves <palves@redhat.com>
Thu, 2 Jul 2020 14:54:36 +0000 (15:54 +0100)
committerPedro Alves <palves@redhat.com>
Fri, 3 Jul 2020 14:00:08 +0000 (15:00 +0100)
commitbf90c83acca6736f451807d3e231b53dc02bc57b
tree49fe9406174dec5f9561eb6064ec411d540c30f1
parent2eb821570037e8836d61ab3dcb9331c21f8a64d9
Fix gdb.base/charset.exp with Clang

gdb.base/charset.exp fails to run with Clang, because of:

 gdb compile failed, /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/charset.c:144:20: warning:
       implicit conversion from 'int' to 'char' changes value from 162 to -94
       [-Wconstant-conversion]
11, 162, 17);
    ^~~
 /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/charset.c:151:16: warning:
       implicit conversion from 'int' to 'char' changes value from 167 to -89
       [-Wconstant-conversion]
167,
^~~
 /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/charset.c:168:16: warning:
       implicit conversion from 'int' to 'char' changes value from 167 to -89
       [-Wconstant-conversion]
167,
^~~
 3 warnings generated.

 === gdb Summary ===

 # of untested testcases         1

Fix it by changing init_string to take unsigned char parameters.

gdb/testsuite/ChangeLog:

* gdb.base/charset.c (init_string): Change all char parameters to
unsigned char parameters.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/charset.c