|
From: | Paul Eggert |
Subject: | Re: Dynamic loading progress |
Date: | Thu, 19 Nov 2015 15:51:29 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 11/19/2015 02:41 PM, Philipp Stephani wrote:
Yeah, that's a bug. I probably meant size to be declared as ptrdiff_t, which is what ASIZE returns.
I've fixed this by changing size_t to ptrdiff_t in the new code (or to int, if it's guaranteed to fit in INT_MAX).
According to http://en.cppreference.com/w/c/language/struct_initialization and https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html designated initializers are part of C99, which is required for building Emacs.
I think designated initializers are pretty safe nowadays. (We don't assume all of C99 even now, by the way, just a reasonably portable subset; but this should be in the subset).
That particular initializer is overkill, though. It's not obvious to the casual reader that it initializes the private members to zero, and I doubt whether any such initialization was intended. (This is one of the downsides of C99 initializers.) I simplified it.
I have more work to do in this area and plan to follow up later.
[Prev in Thread] | Current Thread | [Next in Thread] |