delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/06/02/14:49:19

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <48444091.EBA40B22@dessent.net>
Date: Mon, 02 Jun 2008 11:48:49 -0700
From: Brian Dessent <brian AT dessent DOT net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: Reini Urban <rurban AT x-ray DOT at>
CC: cygwin AT cygwin DOT com
Subject: Re: rebase src patch (Was: rebase not compilable)
References: <6910a60806020741t7ff86d8bgbb7866e62acf1c09 AT mail DOT gmail DOT com> <484411AA DOT AF8A9011 AT dessent DOT net> <484427D6 DOT 4030103 AT x-ray DOT at> <48443F8B DOT 6070104 AT x-ray DOT at>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Reini Urban wrote:

> Got it:
> -  for (; (char *)&relocp->SizeOfBlock < (char *)relocs + size &&
> relocp->SizeOfBlock != 0; ((char *)relocp) += relocp->SizeOfBlock)
> +  for (; (char *)&relocp->SizeOfBlock < *(char**)relocs + size &&
> relocp->SizeOfBlock != 0; (*(char**)relocp) += relocp->SizeOfBlock)

I don't think that's a very good solution, it just trades one error for
another.  Whenever Cygwin finally moves to gcc 4 it's going to break
again because the above violates the C aliasing rules.  Making relocp a
char * should be the right solution because char * can alias everything,
but (struct _IMAGE_BASE_RELOCATION *) cannot alias char **.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019