binutils-gdb/gdb/common
Pedro Alves 7535d5edea Add cast to VEC_iterate
Fixes this in C++:

 ../../src/gdb/break-catch-sig.c: In function ‘int VEC_gdb_signal_type_iterate(const VEC_gdb_signal_type*, unsigned int, gdb_signal_type*)’:
 ../../src/gdb/common/vec.h:576:12: error: invalid conversion from ‘int’ to ‘gdb_signal_type {aka gdb_signal}’ [-fpermissive]
	*ptr = 0;          \
	     ^
 ../../src/gdb/common/vec.h:417:1: note: in expansion of macro ‘DEF_VEC_FUNC_P’
  DEF_VEC_FUNC_P(T)         \
  ^
 ../../src/gdb/break-catch-sig.c:37:1: note: in expansion of macro ‘DEF_VEC_I’
  DEF_VEC_I (gdb_signal_type);
  ^

I actually carried a different fix in the C++ branch that removed this
assignment and then adjusted all callers that depended on it.  The
thinking was that this is for the case where we're returning false,
indicating end of iteration.  But that results in a much larger and
tricker patch; looking back it seems quite pointless.  I looked at the
history of GCC's C++ conversion and saw that they added this same cast
to their version of vec.h, FWIW.  (GCC's vec.h is completely different
nowadays, having been converted to templates meanwhile.)

gdb/ChangeLog:
2015-10-29  Pedro Alves  <palves@redhat.com>

	* common/vec.h (DEF_VEC_FUNC_P) [iterate]: Cast 0 to type T.
2015-10-29 17:39:33 +00:00
..
agent.c
agent.h
ax.def
break-common.h
btrace-common.c
btrace-common.h
buffer.c
buffer.h
cleanups.c
cleanups.h
common-debug.c
common-debug.h
common-defs.h
common-exceptions.c Add cast to exception_none 2015-10-29 12:55:01 +00:00
common-exceptions.h Don't assume break/continue inside a TRY block works 2015-10-29 12:55:01 +00:00
common-regcache.h aarch64 multi-arch part 6: HW breakpoint on unaligned address 2015-10-15 15:05:10 +01:00
common-types.h
common-utils.c
common-utils.h
common.host
common.m4
create-version.sh
errors.c
errors.h
fileio.c
fileio.h
filestuff.c common/filestuff.c (make_cleanup_close): Update comment. 2015-09-28 11:31:54 -07:00
filestuff.h
format.c
format.h
gdb_assert.h
gdb_locale.h
gdb_setjmp.h
gdb_signals.h
gdb_sys_time.h
gdb_vecs.c More char constification 2015-10-13 19:40:50 +01:00
gdb_vecs.h
gdb_wait.h musl: Move W_STOPCODE to common/gdb_wait.h. 2015-10-26 13:24:01 -07:00
host-defs.h
mingw-strerror.c
posix-strerror.c
print-utils.c Make host_address_to_string/gdb_print_host_address cast parameter to 'void *' 2015-10-27 17:33:01 +00:00
print-utils.h Make host_address_to_string/gdb_print_host_address cast parameter to 'void *' 2015-10-27 17:33:01 +00:00
ptid.c
ptid.h
queue.h
rsp-low.c
rsp-low.h
signals.c
symbol.h
vec.c
vec.h Add cast to VEC_iterate 2015-10-29 17:39:33 +00:00
version.h
x86-xstate.h
xml-utils.c
xml-utils.h