Files
binutils-gdb/gdbsupport
Simon Marchi 8cb2c7fc2e gdbsupport: mark array_view::slice with [[nodiscard]]
I (almost) had a bug where I did:

    buffer.slice (...)

but I meant:

    buffer = buffer.slice (...)

The first one does nothing, it creates a new array_view but without
using it, it's useless.  Mark the slice methods with [[nodiscard]]
(which is standard C++17) so that error would generate a warning.

I guess that many functions could be marked as nodiscard, essentially
function that is pure (doesn't have side-effects).  But this one seems
particularly easy to mis-use.

Change-Id: Ib39a0a65a5728a3cfd68a02ae31635810baeaccb
Approved-By: Tom Tromey <tom@tromey.com>
2023-11-03 14:27:26 -04:00
..
2023-09-11 06:15:52 +00:00
2023-06-03 22:43:57 +02:00
2023-10-12 18:23:13 -06:00
2023-06-03 22:43:57 +02:00
2023-06-03 22:43:57 +02:00
2023-06-03 22:43:57 +02:00
2023-02-24 11:53:03 -07:00
2023-06-03 22:43:57 +02:00
2023-06-03 22:43:57 +02:00
2023-09-15 10:36:15 -06:00
2023-06-03 22:43:57 +02:00
2023-06-03 22:43:57 +02:00

This is a helper library that is used by gdb and gdbserver.

To send patches, follow the gdb patch submission instructions in
../gdb/CONTRIBUTE.  For maintainers, see ../gdb/MAINTAINERS.