diff options
author | George Kadianakis <desnacked@riseup.net> | 2016-05-25 12:28:40 +0300 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2016-07-01 14:01:41 -0400 |
commit | 899d2b890b35b9772f33054b9ff627dd8186deac (patch) | |
tree | 915365c8f5af67e92bbcc36a34d40df08d564107 /src/or | |
parent | ebbff3174059f0c1d0fb51a39f97de453ea055f4 (diff) | |
download | tor-899d2b890b35b9772f33054b9ff627dd8186deac.tar.gz tor-899d2b890b35b9772f33054b9ff627dd8186deac.zip |
prop250: Don't use {0} to init static struct -- causes warning on clang.
See ticket #19132 for the clang/llvm warning.
Since voting_schedule is a global static struct, it will be initialized
to zero even without explicitly initializing it with {0}.
This is what the C spec says:
If an object that has automatic storage duration is not initialized
explicitly, its value is indeterminate. If an object that has static
storage duration is not initialized explicitly, then:
— if it has pointer type, it is initialized to a null pointer;
— if it has arithmetic type, it is initialized to (positive or unsigned) zero;
— if it is an aggregate, every member is initialized (recursively) according to these rules;
— if it is a union, the first named member is initialized (recursively) according to these rules.
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/dirvote.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 4eccdd0611..50713318bd 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -2545,7 +2545,7 @@ get_next_valid_after_time(time_t now) return next_valid_after_time; } -static voting_schedule_t voting_schedule = {0}; +static voting_schedule_t voting_schedule; /** Set voting_schedule to hold the timing for the next vote we should be * doing. */ |