* [COMMITTED PATCH] cast Booleanish expression to int when used in switch
@ 2013-10-09 19:40 Roland McGrath
0 siblings, 0 replies; only message in thread
From: Roland McGrath @ 2013-10-09 19:40 UTC (permalink / raw)
To: binutils
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 <rth@tamu.edu>.
@@ -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:
{
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-10-09 19:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-09 19:40 [COMMITTED PATCH] cast Booleanish expression to int when used in switch Roland McGrath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).