From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5653 invoked by alias); 23 May 2013 17:21:36 -0000 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 Received: (qmail 5641 invoked by uid 89); 23 May 2013 17:21:36 -0000 X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS,TW_XS autolearn=ham version=3.3.1 Received: from mail-lb0-f170.google.com (HELO mail-lb0-f170.google.com) (209.85.217.170) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 23 May 2013 17:21:21 +0000 Received: by mail-lb0-f170.google.com with SMTP id t13so3716093lbd.15 for ; Thu, 23 May 2013 10:21:19 -0700 (PDT) X-Received: by 10.112.185.67 with SMTP id fa3mr6929946lbc.118.1369329679008; Thu, 23 May 2013 10:21:19 -0700 (PDT) Received: from [130.237.20.66] (s1499.it.kth.se. [130.237.20.66]) by mx.google.com with ESMTPSA id a5sm5215153laa.2.2013.05.23.10.21.17 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Thu, 23 May 2013 10:21:18 -0700 (PDT) Message-ID: <1369329677.8127.43.camel@s1499.it.kth.se> Subject: Re: Small patch to enable build of gdb-7.6 for GNU/Hurd From: Svante Signell To: Tom Tromey Cc: gdb-patches@sourceware.org Date: Thu, 23 May 2013 17:21:00 -0000 In-Reply-To: <87mwrld3ps.fsf@fleche.redhat.com> References: <1369326967.8127.33.camel@s1499.it.kth.se> <87mwrld3ps.fsf@fleche.redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg00880.txt.bz2 On Thu, 2013-05-23 at 11:07 -0600, Tom Tromey wrote: > >>>>> "Svante" == Svante Signell writes: > > Svante> In case you need feedback from me use Cc: since I'm not subscribed to > Svante> gdb-patches. > > It needs a ChangeLog entry. > > Svante> - xsnprintf (arch_path, sizeof (arch_path), "%s/%s%s", nto_root, arch, endian); > Svante> + arch_len = strlen (nto_root) + 1 + strlen (arch) + strlen (endian) + 1; > Svante> + arch_path = alloca (arch_len); > Svante> + xsnprintf (arch_path, arch_len, "%s/%s%s", nto_root, arch, endian); > > Svante> - xsnprintf (buf, sizeof (buf), "set solib-absolute-prefix %s", arch_path); > Svante> + len = strlen (FMT) - 2 + strlen (arch_path) + 1; > Svante> + buf = alloca (len); > Svante> + xsnprintf (buf, len, FMT, arch_path); > Svante> execute_command (buf, 0); > > I think it would be simpler to use a single xstrprintf plus a cleanup. Thanks for your prompt reply. The code construct I used was the same as the function defined before in the same source file: int nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname) How to create a correct ChangeLog entry? Any tools available, emacs?