From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11610 invoked by alias); 5 Jul 2010 10:17:56 -0000 Received: (qmail 11591 invoked by uid 22791); 5 Jul 2010 10:17:54 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate4.de.ibm.com (HELO mtagate4.de.ibm.com) (195.212.17.164) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Jul 2010 10:17:48 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.13.1/8.13.1) with ESMTP id o65AHZTU015254 for ; Mon, 5 Jul 2010 10:17:35 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o65AHZ5x1442002 for ; Mon, 5 Jul 2010 12:17:35 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o65AHZu1004431 for ; Mon, 5 Jul 2010 12:17:35 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id o65AHXIE004417; Mon, 5 Jul 2010 12:17:33 +0200 Message-Id: <201007051017.o65AHXIE004417@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 05 Jul 2010 12:17:33 +0200 Subject: Re: [RFA-v3] Allow explicit 16 or 32 char in 'x /s' To: tromey@redhat.com (Tom Tromey) Date: Mon, 05 Jul 2010 10:17:00 -0000 From: "Ulrich Weigand" Cc: pierre.muller@ics-cnrs.unistra.fr (Pierre Muller), gdb-patches@sourceware.org, eliz@gnu.org ('Eli Zaretskii') In-Reply-To: from "Tom Tromey" at Jul 02, 2010 01:08:53 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-07/txt/msg00076.txt.bz2 Tom Tromey wrote: > >>>>> "Ulrich" =3D=3D Ulrich Weigand 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' Huh, sorry about that. > It isn't safe here to include , since this test intentionally > defines its own "wchar_t". > > Adding: > > extern void *malloc (int); > > works for me, but it seems possibly problematic. Yes, it really should be size_t, not int (and that may be a real issue on some 64-bit systems). But if you cannot include standard headers, you don't get size_t either ... > Maybe adding -fno-builtin for gcc is the thing to do? > > I am not really sure what is best. Any other ideas? Can we split the testcase so that the parts that require the non-standard wchar_t definition are separate from the parts that construct strings in the inferior? Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com