gdb.base/sizeof.exp C++ify
authorPedro Alves <pedro@palves.net>
Thu, 17 Sep 2020 22:33:43 +0000 (23:33 +0100)
committerPedro Alves <pedro@palves.net>
Thu, 17 Sep 2020 23:08:17 +0000 (00:08 +0100)
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.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/sizeof.c

index 4ecee4bcefd8b9907fd1b84a2d22443c55242096..db141589fcb8990f844b46a8dc150374e3029d46 100644 (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>
 
        * gdb.base/share-env-with-gdbserver.c (main): Add cast.
index fde52139ef8a825c799850318fb7b9ecfc9ceca2..4cf8c55898b8d9f8f561badb4889a7a732104324 100644 (file)
@@ -51,7 +51,7 @@ struct {
 static void
 fill (void *buf, long sizeof_buf)
 {
-  char *p = buf;
+  char *p = (char *) buf;
   int i;
   for (i = 0; i < sizeof_buf; i++)
     p[i] = "The quick brown dingo jumped over the layzy dog."[i];
This page took 0.039084 seconds and 4 git commands to generate.