This is the mail archive of the gdb-patches@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]

Re: [RFA-v3] Allow explicit 16 or 32 char in 'x /s'


>>>>> "Ulrich" == Ulrich Weigand <uweigand@de.ibm.com> writes:

Ulrich> This test required that malloc is present in the inferior; if target
Ulrich> code is statically linked, we need to make sure the routine gets
Ulrich> pulled in (just like other testcases already do).

Ulrich> 	* gdb.base/charset.c (main): Make sure malloc gets linked in.

With this patch I now get:

Running ../../../src/gdb/testsuite/gdb.base/charset.exp ...
gdb compile failed, ../../../src/gdb/testsuite/gdb.base/charset.c: In function âmainâ:
../../../src/gdb/testsuite/gdb.base/charset.c:126: warning: incompatible implicit declaration of built-in function âmallocâ



It isn't safe here to include <stdlib.h>, since this test intentionally
defines its own "wchar_t".

Adding:

extern void *malloc (int);

works for me, but it seems possibly problematic.

Maybe adding -fno-builtin for gcc is the thing to do?

I am not really sure what is best.  Any other ideas?

Tom


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