This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

src/gdb ChangeLog target.c


CVSROOT:	/cvs/src
Module name:	src
Changes by:	palves@sourceware.org	2013-03-07 23:53:12

Modified files:
	gdb            : ChangeLog target.c 

Log message:
	target.c: fix -Wpointer-sign
	
	$ make WERROR_CFLAGS="-Wpointer-sign -Werror" target.o -k 2>&1 1>/dev/null
	../../src/gdb/target.c: In function â??target_read_strallocâ??:
	../../src/gdb/target.c:2376:3: error: pointer targets in passing argument 1 of â??strlenâ?? differ in signedness [-Werror=pointer-sign]
	In file included from build-gnulib/import/string.h:27:0,
	from ../../src/gdb/common/gdb_string.h:24,
	from ../../src/gdb/target.c:24:
	/usr/include/string.h:399:15: note: expected â??const char *â?? but argument is of type â??gdb_byte *â??
	...
	
	This is about the same as the previous patch.
	
	Functions that take or return ascii-ish string arguments usually use
	char* for parameters/return.  That means that at points we call into
	target methods that work with binary blobs, we need casts to/from
	gdb_byte*/char*.  To choose which type for the variables, I usually go
	based on which requires the fewer casts, and what the contents of the
	variable are supposed to hold, which often gives the same answer.
	
	gdb/
	2013-03-07  Pedro Alves  <palves@redhat.com>
	
	* target.c (target_read_stralloc, target_fileio_read_alloc):
	*Cast pointer to 'gdb_byte *' in target call.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15225&r2=1.15226
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/target.c.diff?cvsroot=src&r1=1.320&r2=1.321


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]