old-cross-binutils/gdb/common
Pedro Alves a4e22a5df6 [C++] Fix -Winvalid-offsetof warnings with g++ 4.4
Ref: https://sourceware.org/ml/gdb/2015-12/msg00014.html

Fixes the build in C++ mode with g++ 4.4:

 gdb/btrace.h: In function ‘size_t VEC_btrace_insn_s_embedded_size(int)’:
 gdb/btrace.h:84: error: invalid access to non-static data member ‘VEC_btrace_insn_s::vec’  of NULL object
 gdb/btrace.h:84: error: (perhaps the ‘offsetof’ macro was used incorrectly)
 gdb/btrace.h: In function ‘VEC_btrace_insn_s* VEC_btrace_insn_s_alloc(int)’:
 gdb/btrace.h:84: error: invalid access to non-static data member ‘VEC_btrace_insn_s::vec’  of NULL object
 gdb/btrace.h:84: error: (perhaps the ‘offsetof’ macro was used incorrectly)
 gdb/btrace.h: In function ‘VEC_btrace_insn_s* VEC_btrace_insn_s_copy(VEC_btrace_insn_s*)’:
 gdb/btrace.h:84: error: invalid access to non-static data member ‘VEC_btrace_insn_s::vec’  of NULL object
 gdb/btrace.h:84: error: (perhaps the ‘offsetof’ macro was used incorrectly)
 gdb/btrace.h: In function ‘VEC_btrace_insn_s* VEC_btrace_insn_s_merge(VEC_btrace_insn_s*, VEC_btrace_insn_s*)’:
 gdb/btrace.h:84: error: invalid access to non-static data member ‘VEC_btrace_insn_s::vec’  of NULL object
 gdb/btrace.h:84: error: (perhaps the ‘offsetof’ macro was used incorrectly)
 gdb/btrace.h: In function ‘int VEC_btrace_insn_s_reserve(VEC_btrace_insn_s**, int, const char*, unsigned int)’:
 gdb/btrace.h:84: error: invalid access to non-static data member ‘VEC_btrace_insn_s::vec’  of NULL object
 gdb/btrace.h:84: error: (perhaps the ‘offsetof’ macro was used incorrectly)

gdb/ChangeLog:
2015-12-16  Pedro Alves  <palves@redhat.com>

	* common/vec.h (vec_offset): New macro.
	(DEF_VEC_ALLOC_FUNC_I, DEF_VEC_ALLOC_FUNC_O): Use it instead of
	offsetof.
2015-12-16 19:25:32 +00:00
..
agent.c Add some more casts (1/2) 2015-09-25 14:08:07 -04:00
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 MinGW and attribute format(printf/gnu_printf) 2015-11-17 15:22:39 +00:00
common-exceptions.c [C++] Always use setjmp/longjmp for exceptions 2015-11-17 15:23:15 +00:00
common-exceptions.h [C++] Always use setjmp/longjmp for exceptions 2015-11-17 15:23:15 +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
enum-flags.h Type-safe wrapper for enum flags 2015-11-17 13:31:29 +00:00
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 Add some more casts (1/2) 2015-09-25 14:08:07 -04:00
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 Add some more casts (1/2) 2015-09-25 14:08:07 -04:00
vec.h [C++] Fix -Winvalid-offsetof warnings with g++ 4.4 2015-12-16 19:25:32 +00:00
version.h
x86-xstate.h
xml-utils.c
xml-utils.h