tst-poll.cc has a function write_one() which writes one byte. We didn't
care which byte we were writing, so we didn't bother to initialize the
variable holding this byte. But gcc 11 warns about this.

The solution is to initialize this byte to something - e.g., 0.

Signed-off-by: Nadav Har'El <n...@scylladb.com>
---
 tests/tst-epoll.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/tst-epoll.cc b/tests/tst-epoll.cc
index 82658964..30322240 100644
--- a/tests/tst-epoll.cc
+++ b/tests/tst-epoll.cc
@@ -32,7 +32,7 @@ static void report(bool ok, std::string msg)
 
 static void write_one(int fd)
 {
-    char c;
+    char c = 0;
     int w = write(fd, &c, 1);
     report(w == 1, "write");
 }
-- 
2.31.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/20210615215218.42660-1-nyh%40scylladb.com.

Reply via email to