# SDL: silence unused function warning for SDL\_endswith() on non-linux.

**URL:** <https://discourse.libsdl.org/t/sdl-silence-unused-function-warning-for-sdl-endswith-on-non-linux/38720>\
**Category:** SDL Commits\
**Created:** [September 8, 2022, 8:02pm UTC](https://discourse.libsdl.org/t/sdl-silence-unused-function-warning-for-sdl-endswith-on-non-linux/38720 "2022-09-08T20:02:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [September 8, 2022, 8:02pm UTC](https://discourse.libsdl.org/t/sdl-silence-unused-function-warning-for-sdl-endswith-on-non-linux/38720/1 "2022-09-08T20:02:02Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/787cd580eeefcde30026e29e842eb3e6b236087c>

```diff
From 787cd580eeefcde30026e29e842eb3e6b236087c Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Thu, 8 Sep 2022 23:00:04 +0300
Subject: [PATCH] silence unused function warning for SDL_endswith() on
 non-linux.

---
 src/joystick/SDL_gamecontroller.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c
index 1fd5f5f0237..da3e64b9980 100644
--- a/src/joystick/SDL_gamecontroller.c
+++ b/src/joystick/SDL_gamecontroller.c
@@ -1954,6 +1954,7 @@ SDL_IsGameController(int device_index)
     return SDL_FALSE;
 }
 
+#if defined( __LINUX__ )
 static SDL_bool SDL_endswith(const char *string, const char *suffix)
 {
     size_t string_length = string ? SDL_strlen(string) : 0;
@@ -1966,6 +1967,7 @@ static SDL_bool SDL_endswith(const char *string, const char *suffix)
     }
     return SDL_FALSE;
 }
+#endif
 
 /*
  * Return 1 if the game controller should be ignored by SDL

```
