From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24272 invoked by alias); 9 Oct 2013 19:40:54 -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 24259 invoked by uid 89); 9 Oct 2013 19:40:53 -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-f178.google.com Received: from mail-ie0-f178.google.com (HELO mail-ie0-f178.google.com) (209.85.223.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 09 Oct 2013 19:40:52 +0000 Received: by mail-ie0-f178.google.com with SMTP id to1so2906116ieb.23 for ; Wed, 09 Oct 2013 12:40:50 -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=1nvcKPTMnYiLp+JwV2MjzfX4N5iQEP1NuWIb5nBSeGc=; b=PQFyZEW02KHdKXbIMqnEHHZUcHUk7R7RZVekaUMeYKUgPP/8avdl8damQRxz9eBPca Jv6eSJeoDSXHoczTi4hU8WNY5pKn9e9yiqYJykpFYhmU9cmuUKdkfBxrR9+LT1MbHyfT h93b7HXZJm1+8acniiDb0ShQGgpfYYwF31v3Y0dJxMZz2TPnmVZeRN7aIOmgdGLiFEyZ jhc+EJz8xK5OArIgub/YVlVh8c5H22AuLx3FuSs7hfLFXYr/OpWoRo5n7Qu1h75E6KrX WQD+fJr09EuvJOVfVrmWMoUwBlG5sTSz6dlHwagQjdY+xlB0AyYxpESV//pPvwoSTJRu kxGw== X-Gm-Message-State: ALoCoQnTYqOjSS6Gv9DpumQwjqFIX6XVXHQ7NkeqAU9NHkQDOo9WoJ7ld4S6agWX879VjaYIZ1WsD0T92c9+lUmmKKUHk7XaiXB/7R6i71WWVY4rAj0fxgvKNmVTdKaabm9FwOj5Hbniz8AjCtCGHyLznw/KILC6d4DS5NrOEwhTLAzFkslKzgzlZdy00VOGFuEUEj/6QANVru0/zILg5WrzH0FwKEOM4g== X-Received: by 10.50.147.65 with SMTP id ti1mr3515234igb.12.1381347650652; Wed, 09 Oct 2013 12:40:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.11.68 with HTTP; Wed, 9 Oct 2013 12:40:30 -0700 (PDT) From: Roland McGrath Date: Wed, 09 Oct 2013 19:40:00 -0000 Message-ID: Subject: [COMMITTED PATCH] cast Booleanish expression to int when used in switch To: "binutils@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-10/txt/msg00125.txt.bz2 Committed as obvious enough, to trunk and 2.24 branch. (Clang warns about this by default.) Thanks, Roland bfd/ * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Cast switch expression to int to silence over-eager compiler warnings. --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -1,6 +1,6 @@ /* Alpha specific support for 64-bit ELF Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010, 2011, 2012 + 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. Contributed by Richard Henderson . @@ -3590,7 +3590,9 @@ elf64_alpha_relax_tls_get_addr (struct alpha_relax_info *info, bfd_vma symval, use_gottprel = FALSE; new_symndx = is_gd ? ELF64_R_SYM (irel->r_info) : STN_UNDEF; - switch (!dynamic && !info->link_info->shared) + /* Some compilers warn about a Boolean-looking expression being + used in a switch. The explicit cast silences them. */ + switch ((int) (!dynamic && !info->link_info->shared)) { case 1: {