Don't memset non-POD types: struct breakpoint
authorPedro Alves <palves@redhat.com>
Tue, 25 Apr 2017 00:27:42 +0000 (01:27 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 25 Apr 2017 00:45:21 +0000 (01:45 +0100)
commit16c4d54a71d8052988ed9c8005a03a7f934245f4
tree218c66f316f190d3158922a9ab60c70db55a90a5
parentb5c3668253b909fd1f5b011893a35bb8dfd3be9b
Don't memset non-POD types: struct breakpoint

Eh, struct breakpoint was made non-POD just today, with commit
d28cd78ad820e3 ("Change breakpoint event locations to
event_location_up").  :-)

  src/gdb/breakpoint.c: In function ‘void init_raw_breakpoint_without_location(breakpoint*, gdbarch*, bptype, const breakpoint_ops*)’:
  src/gdb/breakpoint.c:7447:28: error: use of deleted function ‘void* memset(T*, int, size_t) [with T = breakpoint; <template-parameter-1-2> = void; size_t = long unsigned int]’
     memset (b, 0, sizeof (*b));
      ^
  In file included from src/gdb/common/common-defs.h:85:0,
   from src/gdb/defs.h:28,
   from src/gdb/breakpoint.c:20:
  src/gdb/common/poison.h:56:7: note: declared here
   void *memset (T *s, int c, size_t n) = delete;
 ^

gdb/ChangeLog:
2017-04-25  Pedro Alves  <palves@redhat.com>

* breakpoint.h (struct breakpoint): In-class initialize all
fields.  Make boolean fields "bool".
* breakpoint.c (init_raw_breakpoint_without_location): Remove
memset call and initializations no longer necessary.
gdb/ChangeLog
gdb/breakpoint.c
gdb/breakpoint.h