FreeBSD versions older than 11.0 use char * as the type of ss_sp in
stack_t instead of the standards-defined void *. C++ allows a char *
pointer to be converted to a void *, so it is safe to cast the return
value of xmalloc to char * if ss_sp is either a char * or void *.
Just always use the cast to char * since that is less ugly than having
to add a special case.
gdb/ChangeLog:
* main.c (setup_alternate_signal_stack): Cast to char *.
+2016-04-19 John Baldwin <jhb@FreeBSD.org>
+
+ * main.c (setup_alternate_signal_stack): Cast to char *.
+
2016-04-19 Doug Evans <xdje42@gmail.com>
* symmisc.c (dump_symtab_1, dump_symtab): Delete arg objfile.
#ifdef HAVE_SIGALTSTACK
stack_t ss;
- ss.ss_sp = xmalloc (SIGSTKSZ);
+ /* FreeBSD versions older than 11.0 use char * for ss_sp instead of
+ void *. This cast works with both types. */
+ ss.ss_sp = (char *) xmalloc (SIGSTKSZ);
ss.ss_size = SIGSTKSZ;
ss.ss_flags = 0;