From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24027 invoked by alias); 10 Oct 2013 22:51: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 24016 invoked by uid 89); 10 Oct 2013 22:51:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ie0-f171.google.com Received: from mail-ie0-f171.google.com (HELO mail-ie0-f171.google.com) (209.85.223.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 10 Oct 2013 22:51:42 +0000 Received: by mail-ie0-f171.google.com with SMTP id at1so6382438iec.2 for ; Thu, 10 Oct 2013 15:51:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=dsLBTnmf7aVgYkco2UCQ5LvFEXNbCWzyHUxavsDgJhA=; b=itPG2dFsaR9eRRcC98tyrYTSdicwO9Jsq10L8Ma35P4Fkx53ttxMvkazjiAXqhbMdJ JAUe9HX3/5jiicDe+7SpV4B09xXTyOUUTbk2HpA5JPlAwd9NcnL8lFc/KAiIsYLf7grL VSGCCAlxCe/Gf1oCdqoS0e1ap0eN8PlL78v2SloAJL1/GZI+k+GKozMOOtTAgWCVWGx7 yCOdyDBMPNquDlbHd/6kjs7UEgCPfRImNu4kctrHM2eTMch1wW6aeWhigk9N7OlgwJN0 5i2OFl4MMTLkB/22ywVr48vQ7Abb2QJvngOQB4+l8vJdUAM8XQ/PB6S8FtpgHGVhGPLe u2Zw== X-Gm-Message-State: ALoCoQl3OLcvBXVYdBEssSh3KkyCUKkZyW/M0UfqaAun1J2qEKh8v0KK6Zvnu6XARYCBJD/51FlY2KWcNlWZqxcKqsAgkVZ9Z/n0lPONO6ZpRzGIdR+Jd5W7WGRfy3ovtZhgc4CHDG4L0m3SVQYbkFviGK5FHcid5+2ZRRCsuD3VlPCw5Zl0oeT9ePqwp3kSEGSpKEJCTk4xEJfshDEULVEUewxCGKGHHQ== X-Received: by 10.43.11.69 with SMTP id pd5mr2072656icb.62.1381445500579; Thu, 10 Oct 2013 15:51:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.11.68 with HTTP; Thu, 10 Oct 2013 15:51:20 -0700 (PDT) From: Roland McGrath Date: Thu, 10 Oct 2013 22:51:00 -0000 Message-ID: Subject: [COMMITTED PATCH] avoid strange arithmetic with strings in ldmisc.c To: "binutils@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-10/txt/msg00147.txt.bz2 Committed as obvious enough, to trunk and 2.24 branch. Thanks, Roland ld/ 2013-10-10 Roland McGrath * ldmisc.c (vfinfo): Use Boolean ? "" : ":" in place of ":" + Boolean. It silences some compilers' warnings and is much less bizarre to read. --- a/ld/ldmisc.c +++ b/ld/ldmisc.c @@ -1,6 +1,6 @@ /* ldmisc.c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012 + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. @@ -361,7 +361,7 @@ vfinfo (FILE *fp, const char *fmt, va_list arg, bfd_boolean is_warning) if (functionname != NULL && fmt[-1] == 'G') lfinfo (fp, "%T", functionname); else if (filename != NULL && linenumber != 0) - fprintf (fp, "%u%s", linenumber, ":" + done); + fprintf (fp, "%u%s", linenumber, done ? "" : ":"); else done = FALSE; }