This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA-v3] Allow explicit 16 or 32 char in 'x /s'
- From: Tom Tromey <tromey at redhat dot com>
- To: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- Cc: pierre dot muller at ics-cnrs dot unistra dot fr (Pierre Muller), gdb-patches at sourceware dot org, eliz at gnu dot org ('Eli Zaretskii')
- Date: Fri, 02 Jul 2010 13:08:53 -0600
- Subject: Re: [RFA-v3] Allow explicit 16 or 32 char in 'x /s'
- References: <001201cad75e$2ef3fcc0$8cdbf640$@muller@ics-cnrs.unistra.fr> <201006111737.o5BHbi88031827@d12av02.megacenter.de.ibm.com>
>>>>> "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