git://developer.intra2net.com
/
libi2ncommon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
8bbcf80
)
Fix missing initializer for timespec
author
Thomas Jarosch
<thomas.jarosch@intra2net.com>
Tue, 30 Dec 2025 09:11:43 +0000 (10:11 +0100)
committer
Thomas Jarosch
<thomas.jarosch@intra2net.com>
Wed, 31 Dec 2025 11:11:25 +0000 (12:11 +0100)
Original warning:
src/timefunc.cpp:50:30: error: missing initializer for member 'timespec::tv_nsec' [-Werror=missing-field-initializers]
Fixed by initializing both members: struct timespec ts = { 0, 0 };
src/timefunc.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/timefunc.cpp
b/src/timefunc.cpp
index
5e3eb9f
..
da25f04
100644
(file)
--- a/
src/timefunc.cpp
+++ b/
src/timefunc.cpp
@@
-47,7
+47,7
@@
using namespace std;
double prec_time(void)
{
- struct timespec ts = { 0 };
+ struct timespec ts = { 0, 0 };
double ret = 0.0;
if (clock_gettime(CLOCK_REALTIME_COARSE, &ts) == -1) {