Add two missing return values in gdb.python/py-nested-maps.c
authorGary Benson <gbenson@redhat.com>
Tue, 16 Jun 2020 11:41:28 +0000 (12:41 +0100)
committerGary Benson <gbenson@redhat.com>
Tue, 16 Jun 2020 11:41:28 +0000 (12:41 +0100)
Two functions in gdb.python/py-nested-maps.c are missing return
values.  This causes clang to fail to compile the file with the
following error:
  warning: control reaches end of non-void function [-Wreturn-type]

This commit fixes, by causing the two functions to return pointers
to the objects they've just allocated and initialized.  I didn't
investigate how this test had been passing with other compilers;
I'm assuming serendipity, that in each function the value to be
returned was already in the register it would need to be in to be
the function's return value.

gdb/testsuite/ChangeLog:

* gdb.python/py-nested-maps.c (create_map): Add missing return
value.
(create_map_map): Likewise.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/py-nested-maps.c

index 6fe1877132b9555b0829c27ae1e5548d2a6057af..d2ed9db4ebb7b2d72b3faacaac69f8478f895e54 100644 (file)
@@ -1,3 +1,9 @@
+2020-06-16  Gary Benson <gbenson@redhat.com>
+
+       * gdb.python/py-nested-maps.c (create_map): Add missing return
+       value.
+       (create_map_map): Likewise.
+
 2020-06-15  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
 
        * gdb.base/jit-elf-so.exp: Refer to the global main_loader_basename
index 665efa1b5abccac5e1d9cff811e4085de033b5ea..860b473ea4d99d1c50376315c8b021c7100263a7 100644 (file)
@@ -62,6 +62,7 @@ create_map (const char *name)
   m->keys = NULL;
   m->values = NULL;
   m->show_header = 0;
+  return m;
 }
 
 void
@@ -85,6 +86,7 @@ create_map_map (void)
   mm->length = 0;
   mm->values = NULL;
   mm->show_header = 0;
+  return mm;
 }
 
 void
This page took 0.031936 seconds and 4 git commands to generate.