From b416685d6f601a12a9fd6428aa605a6f12330ef2 Mon Sep 17 00:00:00 2001 From: Gabi Melman Date: Mon, 9 Apr 2018 02:06:33 +0300 Subject: [PATCH] Fix gcc warning on stat (32 bits) --- include/spdlog/details/os.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/spdlog/details/os.h b/include/spdlog/details/os.h index 2eeeeb38..cd3e702b 100644 --- a/include/spdlog/details/os.h +++ b/include/spdlog/details/os.h @@ -244,9 +244,8 @@ inline size_t filesize(FILE *f) return static_cast(st.st_size); } #else // unix 32 bits or cygwin - struct stat st - { - }; + struct stat st; + if (fstat(fd, &st) == 0) { return static_cast(st.st_size);