emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MPS symbols


From: Helmut Eller
Subject: Re: MPS symbols
Date: Fri, 28 Jun 2024 18:19:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]