[binutils-gdb] vec.h: Add casts for C++ compat

Simon Marchi simark@sourceware.org
Thu Oct 1 15:29:00 GMT 2015


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=dd0a637a3d8f5ca7229131c085ef6b8e255d01f6

commit dd0a637a3d8f5ca7229131c085ef6b8e255d01f6
Author: Simon Marchi <simon.marchi@ericsson.com>
Date:   Thu Oct 1 11:29:08 2015 -0400

    vec.h: Add casts for C++ compat
    
    gdb/ChangeLog:
    
    	* common/vec.h (VEC_OP (T,cleanup)): Add pointer cast.

Diff:
---
 gdb/ChangeLog    | 4 ++++
 gdb/common/vec.h | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 46b36ad..f9ef565 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2015-10-01  Simon Marchi  <simon.marchi@ericsson.com>
+
+	* common/vec.h (VEC_OP (T,cleanup)): Add pointer cast.
+
 2015-09-30  Doug Evans  <dje@google.com>
 
 	* dwarf2read.c (setup_type_unit_groups): Add comment.
diff --git a/gdb/common/vec.h b/gdb/common/vec.h
index 41e41b5..2564485 100644
--- a/gdb/common/vec.h
+++ b/gdb/common/vec.h
@@ -496,7 +496,7 @@ static inline void VEC_OP (T,free)					  \
 static inline void VEC_OP (T,cleanup)					  \
      (void *arg_)							  \
 {									  \
-  VEC(T) **vec_ = arg_;							  \
+  VEC(T) **vec_ = (VEC(T) **) arg_;					  \
   if (*vec_)								  \
     vec_free_ (*vec_);							  \
   *vec_ = NULL;								  \
@@ -743,7 +743,7 @@ static inline void VEC_OP (T,free)					  \
 static inline void VEC_OP (T,cleanup)					  \
      (void *arg_)							  \
 {									  \
-  VEC(T) **vec_ = arg_;							  \
+  VEC(T) **vec_ = (VEC(T) **) arg_;					  \
   if (*vec_)								  \
     vec_free_ (*vec_);							  \
   *vec_ = NULL;								  \
@@ -1053,7 +1053,7 @@ static inline void VEC_OP (T,free)					  \
 static inline void VEC_OP (T,cleanup)					  \
      (void *arg_)							  \
 {									  \
-  VEC(T) **vec_ = arg_;							  \
+  VEC(T) **vec_ = (VEC(T) **) arg_;					  \
   if (*vec_)								  \
     vec_free_ (*vec_);							  \
   *vec_ = NULL;								  \



More information about the Gdb-cvs mailing list