From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8792 invoked by alias); 30 May 2014 02:50:43 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 8762 invoked by uid 89); 30 May 2014 02:50:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-pa0-f46.google.com Received: from mail-pa0-f46.google.com (HELO mail-pa0-f46.google.com) (209.85.220.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 30 May 2014 02:50:38 +0000 Received: by mail-pa0-f46.google.com with SMTP id kq14so1174088pab.33 for ; Thu, 29 May 2014 19:50:37 -0700 (PDT) X-Received: by 10.68.161.101 with SMTP id xr5mr5424743pbb.168.1401418237240; Thu, 29 May 2014 19:50:37 -0700 (PDT) Received: from [192.168.1.119] ([124.127.118.42]) by mx.google.com with ESMTPSA id dz4sm11349606pab.47.2014.05.29.19.50.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 May 2014 19:50:36 -0700 (PDT) Message-ID: <5387F1F7.8090207@gmail.com> Date: Fri, 30 May 2014 02:50:00 -0000 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: jan.kratochvil@redhat.com, drow@false.org, ezannoni@kwikemart.cygnus.com, brobecker@gnat.com, muller@sourceware.org, palves@redhat.com, nickc@redhat.com, macro@linux-mips.org, binutils@sourceware.org Subject: Re: [PATCH] readline/util.c: use '%d' instead of 'ld' to avoid compiling warning References: <5387CCBD.7070203@gmail.com> <20140530021507.GT6679@bubble.grove.modra.org> In-Reply-To: <20140530021507.GT6679@bubble.grove.modra.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-05/txt/msg00287.txt.bz2 On 05/30/2014 10:15 AM, Alan Modra wrote: > On Fri, May 30, 2014 at 08:11:41AM +0800, Chen Gang wrote: >> getpid() will return 'pid_t' which is always 'int', so need use '%d' >> instead of '%ld' in sprintf(). > > Please do not copy many lists and/or maintainers. This patch should > have gone just to gdb-patches@sourceware.org, since readline belongs > to the gdb project. > > Also, gdb and binutils generally require patches to be supplied with a > ChangeLog entry. See other posts on the mailing list. > OK, thanks. If we have a tool to tell members (especially new members) the related mailing addresses (e.g. "scripts/get_maintainer.pl" under Linux kernel and/or Qemu), that will be cool! > Now, on to the substance of your patch. It's wrong to claim that > "pid_t" is always "int". I know of systems that use or used to use > "short". In fact > http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html > says > > "The implementation shall support one or more programming environments > in which the widths of blksize_t, pid_t, size_t, ssize_t, and > suseconds_t are no greater than the width of type long." > > So the correct patch would be to cast the return of getpid() to long, > continuing to use '%ld' in the format string. > That sounds fine to me. Please help integrate it into mainline. If need me send patch v2, please let me know (no reply means "will integrate the correct fix into mainline by maintainers directly"). Thanks. -- Chen Gang Open, share, and attitude like air, water, and life which God blessed