From a8e5c530ee08851ef5675bfe28e1158a75e0e59d Mon Sep 17 00:00:00 2001 From: Luflosi Date: Mon, 25 May 2020 15:42:52 +0200 Subject: [PATCH] Replace %m conversion specifier with %s and strerror() When compiling with `-Wall` and `-pedantic-errors`, gcc complains with ``` warning: ISO C does not support the '%m' gnu_printf format [-Wformat=] ``` because the `%m` conversion specifier is a GNU extension. Closes #1702. (cherry picked from commit d4f50745356fd38e30100d50418b83db24755994) --- src/wl_window.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index a9025718..61785fe7 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -208,8 +208,8 @@ static struct wl_buffer* createShmBuffer(const GLFWimage* image) if (fd < 0) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Creating a buffer file for %d B failed: %m", - length); + "Wayland: Creating a buffer file for %d B failed: %s", + length, strerror(errno)); return NULL; } @@ -217,7 +217,7 @@ static struct wl_buffer* createShmBuffer(const GLFWimage* image) if (data == MAP_FAILED) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: mmap failed: %m"); + "Wayland: mmap failed: %s", strerror(errno)); close(fd); return NULL; }