Skip to content

Commit 06e8b79

Browse files
nyhwkozaczuk
authored andcommitted
tests: fix warning in tst-epoll.cc
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 <[email protected]> Message-Id: <[email protected]>
1 parent a669c61 commit 06e8b79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/tst-epoll.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static void report(bool ok, std::string msg)
3232

3333
static void write_one(int fd)
3434
{
35-
char c;
35+
char c = 0;
3636
int w = write(fd, &c, 1);
3737
report(w == 1, "write");
3838
}

0 commit comments

Comments
 (0)