Dummy leftover in d3037ba6a398d37585b3d34ff9ed439848ba98a1

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Dummy leftover in d3037ba6a398d37585b3d34ff9ed439848ba98a1

Dmitry Antipov
g++ -x c++  -O0 -g3   -I. -I../../gdb -I../../gdb/common -I../../gdb/config -DLOCALEDIR="\"/home/dantipov/.local/gdb-8.0.50/share/locale\"" -DHAVE_CONFIG_H -I../../gdb/../include/opcode
-I../../gdb/../opcodes/.. -I../../gdb/../readline/.. -I../../gdb/../zlib -I../bfd -I../../gdb/../bfd -I../../gdb/../include -I../libdecnumber -I../../gdb/../libdecnumber  -I../../gdb/gnulib/import
-Ibuild-gnulib/import   -DTUI=1  -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable
-Wno-sign-compare -Wno-narrowing -Wno-error=maybe-uninitialized -Werror -c -o regcache.o -MT regcache.o -MMD -MP -MF ./.deps/regcache.Tpo ../../gdb/regcache.c
In file included from ../../gdb/common/common-defs.h:79:0,
                  from ../../gdb/defs.h:28,
                  from ../../gdb/regcache.c:20:
../../gdb/regcache.c: In member function ‘register_status regcache::xfer_part(int, int, int, void*, const void*, bool)’:
../../gdb/regcache.c:935:24: error: the address of ‘ssize_t read(int, void*, size_t)’ will never be NULL [-Werror=address]
        gdb_assert (read != NULL);
                         ^
../../gdb/common/gdb_assert.h:34:13: note: in definition of macro ‘gdb_assert’
    ((void) ((expr) ? 0 :                                                       \
              ^~~~
cc1plus: all warnings being treated as errors

IIUC this gdb_assert () is no longer needed:

diff --git a/gdb/regcache.c b/gdb/regcache.c
index 555db578b6..603d2f211c 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -932,7 +932,6 @@ regcache::xfer_part (int regnum, int offset, int len, void *in,
      {
        enum register_status status;

-      gdb_assert (read != NULL);
        if (is_raw)
         status = raw_read (regnum, reg);
        else

Dmitry


Reply | Threaded
Open this post in threaded view
|

Re: Dummy leftover in d3037ba6a398d37585b3d34ff9ed439848ba98a1

Tom Tromey-2
>>>>> "Dmitry" == Dmitry Antipov <[hidden email]> writes:

Dmitry> IIUC this gdb_assert () is no longer needed:
[...]
Dmitry> -      gdb_assert (read != NULL);

Yes, that's correct; but FWIW this is already fixed in git master.

Tom