[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MPS symbols
From: |
Eli Zaretskii |
Subject: |
Re: MPS symbols |
Date: |
Fri, 28 Jun 2024 20:40:13 +0300 |
> From: Helmut Eller <eller.helmut@gmail.com>
> Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org
> Date: Fri, 28 Jun 2024 18:19:23 +0200
>
> On Fri, Jun 28 2024, Eli Zaretskii wrote:
>
> >> -extern EMACS_INT pure[];
> >> +extern EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1)
> >> + / sizeof (EMACS_INT)];
> >
> > I don't understand why you moved the definition of puresize[] from
> > alloc.c to puresize.h. If we need the same definition in two source
> > files, and you don't want to repeat it more than once, just do the
> > arithmetics in puresize.h and leave the definition simple, like this:
> >
> > EMACS_INT pure[pure_size];
> >
> > where pure_size is computed in puresize.h.
> >
> > Having dimension in an extern declaration in a header file is at least
> > unusual, if not unportable.
>
> I guess it's a matter of taste. If the array type includes the length,
> then the compiler knows the size and sizeof(pure) works. That's all.
The dimension is part of the definition, not of the declaration. You
rely on the linker to supply the dimension, but that's not how things
are done in C.
- Re: MPS symbols, (continued)
- Re: MPS symbols, Eli Zaretskii, 2024/06/28
- Re: MPS symbols, Gerd Möllmann, 2024/06/28
- Re: MPS symbols, Helmut Eller, 2024/06/28
- Re: MPS symbols, Gerd Möllmann, 2024/06/28
- Re: MPS symbols, Gerd Möllmann, 2024/06/28
- Re: MPS symbols, Helmut Eller, 2024/06/28
- Re: MPS symbols, Eli Zaretskii, 2024/06/28
- Re: MPS symbols, Helmut Eller, 2024/06/28
- Re: MPS symbols,
Eli Zaretskii <=
- Re: MPS symbols, Gerd Möllmann, 2024/06/28
- Re: MPS symbols, Eli Zaretskii, 2024/06/28
- Re: MPS symbols, Gerd Möllmann, 2024/06/28