gdb.base/sizeof.exp C++ify

Fixes:

  src/gdb/testsuite/gdb.base/sizeof.c:54:9: error: cannot initialize a variable of type 'char *' with an lvalue of type 'void *'

... when the testcase is built with a C++ compiler.

gdb/testsuite/ChangeLog:

	* gdb.base/sizeof.c (fill): Add cast.
This commit is contained in:
Pedro Alves
2020-09-17 23:33:43 +01:00
parent 3a5eeb8b63
commit ef0cdbc16f
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2020-09-17 Pedro Alves <pedro@palves.net>
* gdb.base/sizeof.c (fill): Add cast.
2020-09-17 Pedro Alves <pedro@palves.net> 2020-09-17 Pedro Alves <pedro@palves.net>
* gdb.base/share-env-with-gdbserver.c (main): Add cast. * gdb.base/share-env-with-gdbserver.c (main): Add cast.

View File

@ -51,7 +51,7 @@ struct {
static void static void
fill (void *buf, long sizeof_buf) fill (void *buf, long sizeof_buf)
{ {
char *p = buf; char *p = (char *) buf;
int i; int i;
for (i = 0; i < sizeof_buf; i++) for (i = 0; i < sizeof_buf; i++)
p[i] = "The quick brown dingo jumped over the layzy dog."[i]; p[i] = "The quick brown dingo jumped over the layzy dog."[i];