GNU bug report logs - #8546
fix for Emacs pseudovector incompatibility with GCC 4.6.0

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Mon, 25 Apr 2011 07:43:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #27 received at 8546-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 8546-done <at> debbugs.gnu.org
Subject: Re: bug#8546: fix for Emacs pseudovector incompatibility with GCC
	4.6.0
Date: Tue, 26 Apr 2011 21:30:16 -0700
On 04/26/11 18:11, Stefan Monnier wrote:
> But that doesn't explain why we need "struct vectorlike_header".
> Since the macros could cast to "EMACS_UINT*" instead to access to size
> field and that give us the same result.

The C standard allows implementations where 'EMACS_UINT *' uses a
different representation from 'struct buffer *'.  On a word-based
machine, for example, 'EMACS_INT *' might have a one-word representation,
but 'struct buffer *' would have to be byte-addressible (as all
struct pointers must "smell the same" in C) and therefore might have
two words.  On such a machine, ((EMACS_UINT) p) would return a
different integer than ((EMACS_UINT) &p->size).

In practice, though, I doubt whether Emacs will ever be ported
to a word-based machine, so this objection is mostly theoretical,
and if you prefer the macros to cast to "EMACS_UINT *" instead
I could easily write a patch to do that.




This bug report was last modified 14 years and 80 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.