GNU bug report logs - #15825
unidata-gen seems messed up somehow

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Thu, 7 Nov 2013 03:18:02 UTC

Severity: important

Found in version 24.3.50

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>, Glenn Morris <rgm <at> gnu.org>
Cc: 15825 <at> debbugs.gnu.org
Subject: bug#15825: unidata-gen seems messed up somehow
Date: Fri, 08 Nov 2013 00:07:43 -0800
Eli Zaretskii wrote:
> What does 'sizeof' return for a struct that has array[0] at the end?

For something like this:

   struct s { ...; int data[]; };

C99 says sizeof (struct s) == offsetof (struct s, data).
C89 doesn't have this concept, so for portability
we do this in C89:

   struct s { ...; int data[1]; };

and use offsetof (struct s, data) instead of
sizeof (struct s), as the latter's wrong for C89.




This bug report was last modified 11 years and 280 days ago.

Previous Next


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