|
From: | Paul Eggert |
Subject: | Re: Dynamic loading progress |
Date: | Fri, 20 Nov 2015 12:47:59 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
Philipp Stephani wrote:
This member will typically be used as follows: if (env->size >= sizeof *env) { // good, object is at least as big as expected } else { // Emacs is too old }
I'm leery of recommending this sort of checking. In practice incompatible structure layout changes so often involve something more than merely extending a structure, that a size check is not worth the trouble; you really want a version check. I might be persuaded that it's a good idea if I saw some code doing it effectively, but currently there is no such code in the Emacs sources (the module test function doesn't check sizes -- why not?).
[Prev in Thread] | Current Thread | [Next in Thread] |