# SDL: testautomation\_stdlib.c (stdlib\_strtox): fix warning from gcc-4.9:

**URL:** <https://discourse.libsdl.org/t/sdl-testautomation-stdlib-c-stdlib-strtox-fix-warning-from-gcc-4-9/54331>\
**Category:** SDL Commits\
**Created:** [September 17, 2024, 10:04pm UTC](https://discourse.libsdl.org/t/sdl-testautomation-stdlib-c-stdlib-strtox-fix-warning-from-gcc-4-9/54331 "2024-09-17T22:04:01Z")\
**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 17, 2024, 10:04pm UTC](https://discourse.libsdl.org/t/sdl-testautomation-stdlib-c-stdlib-strtox-fix-warning-from-gcc-4-9/54331/1 "2024-09-17T22:04:02Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/8caf25f7b30d15b383b713a016dd84275940d4d0>
>
> test/testautomation\_stdlib.c: In function 'stdlib\_strtox':
> test/testautomation\_s…tdlib.c:1339:9: warning: this decimal constant is unsigned only in ISO C90
> STRTOX\_TEST\_CASE(SDL\_strtoul, unsigned long, "%lu", "4294967295", 10, 4294967295, 10);
> ^
> test/testautomation\_stdlib.c:1340:9: warning: this decimal constant is unsigned only in ISO C90
> STRTOX\_TEST\_CASE(SDL\_strtoul, unsigned long, "%lu", "4294967296", 10, 4294967295, 10);
> ^

```diff
From 8caf25f7b30d15b383b713a016dd84275940d4d0 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Wed, 18 Sep 2024 01:03:10 +0300
Subject: [PATCH] testautomation_stdlib.c (stdlib_strtox): fix warning from
 gcc-4.9:

test/testautomation_stdlib.c: In function 'stdlib_strtox':
test/testautomation_stdlib.c:1339:9: warning: this decimal constant is unsigned only in ISO C90
         STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "4294967295", 10, 4294967295, 10);
         ^
test/testautomation_stdlib.c:1340:9: warning: this decimal constant is unsigned only in ISO C90
         STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "4294967296", 10, 4294967295, 10);
         ^
---
 test/testautomation_stdlib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/testautomation_stdlib.c b/test/testautomation_stdlib.c
index b21dac50d0bb7..d49da29c7eca6 100644
--- a/test/testautomation_stdlib.c
+++ b/test/testautomation_stdlib.c
@@ -1336,8 +1336,8 @@ static int SDLCALL stdlib_strtox(void *arg)
         STRTOX_TEST_CASE(SDL_strtol, long, "%ld", "-2147483649", 10, -2147483647L - 1, 11);
         STRTOX_TEST_CASE(SDL_strtol, long, "%ld", "-9999999999999999999999999999999999999999", 10, -2147483647L - 1, 41);
 
- STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "4294967295", 10, 4294967295, 10);
- STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "4294967296", 10, 4294967295, 10);
+ STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "4294967295", 10, 4294967295UL, 10);
+ STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "4294967296", 10, 4294967295UL, 10);
         STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "-4294967295", 10, 1, 11);
     }
 

```
