diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-06-27 18:34:30 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-06-28 01:35:39 +0000 |
commit | e0a9192ebceba1e7d010a75592b101e4b80b952a (patch) | |
tree | 7e9f433aaa773109dc38cd13c47867bea646c8d1 /epan/dissectors/packet-ieee802154.c | |
parent | 7321df2a4532d6531eab75f99c5f158ffd90574b (diff) |
Don't worry about initializing auto aggregates with non-constant values.
On UN*X, you can get C99-or-later compilers, and we request that in the
autoconf script, so it's really a requirement.
At least as I read
https://msdn.microsoft.com/en-us/library/34h23df8%28v=vs.100%29.aspx
Visual Studio 2010 (and earlier, going back to VS .NET 2003) supports
the "Use of block-scope variables initialized with nonconstant
expressions", with an example of an aggregate (array) initialization
involving function calls, so it sounds as if it's available on Windows
with any version of VS that we support.
(If I've missed something, it'll presumably show up when something is
built with MSVC, and we can update this at that point.)
So the only thing to avoid is initializing global or static variables
with a value that has to be evaluated at run time (the ability to do
that is probably present in most environments, as I think C++
constructors for variables with static storage duration might have to be
evaluated before main() is called, but I guess few C compilers bother to
use it).
Expand the example in the hopes of avoiding confusion between "static
storage duration" (which something declared "static" has, but which
anything declared with file scope, whether declared "static" or not,
also has) and "static storage duration and internal linkage", which is
what the "static" keyword specifies.
Change-Id: I338eb0892e656c2ab59519e4bf76e1dfbec2fa7d
Reviewed-on: https://code.wireshark.org/review/22434
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-ieee802154.c')
0 files changed, 0 insertions, 0 deletions