Fix missing initializer for timespec
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 30 Dec 2025 09:11:43 +0000 (10:11 +0100)
committerThomas 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

index 5e3eb9f..da25f04 100644 (file)
@@ -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) {