public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: dj@redhat.com, gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org
Subject: Re: Compilation warning in simple-object-xcoff.c
Date: Wed, 17 Jan 2018 15:21:00 -0000	[thread overview]
Message-ID: <83tvvkwlyn.fsf@gnu.org> (raw)
In-Reply-To: <87tvvljwfc.fsf@linux-m68k.org> (message from Andreas Schwab on	Tue, 16 Jan 2018 23:00:55 +0100)

> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: Eli Zaretskii <eliz@gnu.org>,  gcc-patches@gcc.gnu.org,  gdb-patches@sourceware.org
> Date: Tue, 16 Jan 2018 23:00:55 +0100
> 
> On Jan 16 2018, DJ Delorie <dj@redhat.com> wrote:
> 
> > And it's not the host's bit size that counts; there are usually ways to
> > get 64-bit file operations on 32-bit hosts.
> 
> If ACX_LARGEFILE doesn't succeed in enabling those 64-bit file
> operations (thus making off_t a 64-bit type) then you are out of luck
> (or AC_SYS_LARGEFILE doesn't support your host yet).

Yes, AC_SYS_LARGEFILE doesn't support MinGW.

DJ, would the following semi-kludgey workaround be acceptable?

--- libiberty/simple-object-xcoff.c~0	2018-01-12 05:31:04.000000000 +0200
+++ libiberty/simple-object-xcoff.c	2018-01-17 12:21:08.496186000 +0200
@@ -596,13 +596,19 @@ simple_object_xcoff_find_sections (simpl
 	      aux = (unsigned char *) auxent;
 	      if (u64)
 		{
+		  /* Use an intermediate 64-bit type to avoid
+		     compilation warning about 32-bit shift below on
+		     hosts with 32-bit off_t which aren't supported by
+		     AC_SYS_LARGEFILE.  */
+		  ulong_type x_scnlen64;
+
 		  if ((auxent->u.xcoff64.x_csect.x_smtyp & 0x7) != XTY_SD
 		      || auxent->u.xcoff64.x_csect.x_smclas != XMC_XO)
 		    continue;
 
-		  x_scnlen = fetch_32 (aux + offsetof (union external_auxent,
-						       u.xcoff64.x_csect.x_scnlen_hi));
-		  x_scnlen = x_scnlen << 32
+		  x_scnlen64 = fetch_32 (aux + offsetof (union external_auxent,
+							 u.xcoff64.x_csect.x_scnlen_hi));
+		  x_scnlen = x_scnlen64 << 32
 			   | fetch_32 (aux + offsetof (union external_auxent,
 						       u.xcoff64.x_csect.x_scnlen_lo));
 		}

  reply	other threads:[~2018-01-17 15:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16 17:45 Eli Zaretskii
2018-01-16 18:01 ` DJ Delorie
2018-01-16 18:25   ` Eli Zaretskii
2018-01-16 18:38     ` DJ Delorie
2018-01-16 22:01       ` Andreas Schwab
2018-01-17 15:21         ` Eli Zaretskii [this message]
2018-01-17 20:48           ` DJ Delorie
2018-01-18  3:25             ` Eli Zaretskii
2018-01-20 12:48               ` Eli Zaretskii
2018-01-21  5:01                 ` Ian Lance Taylor via gdb-patches
2018-01-21 15:45                   ` Eli Zaretskii
2018-01-21 15:45                   ` Eli Zaretskii
2018-01-22  4:27                     ` Joel Brobecker
2018-01-27 16:43                       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83tvvkwlyn.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dj@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).