# SDL: SDL\_os2messagebox.c: silence -Wpointer-to-int-cast.

**URL:** <https://discourse.libsdl.org/t/sdl-sdl-os2messagebox-c-silence-wpointer-to-int-cast/69459>\
**Category:** SDL Commits\
**Created:** [October 2, 2026, 10:13am UTC](https://discourse.libsdl.org/t/sdl-sdl-os2messagebox-c-silence-wpointer-to-int-cast/69459 "2026-10-02T10:13:09Z")\
**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:** [October 2, 2026, 10:13am UTC](https://discourse.libsdl.org/t/sdl-sdl-os2messagebox-c-silence-wpointer-to-int-cast/69459/1 "2026-10-02T10:13:09Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/4035927db2e82c8f12cb64764c77184ee60e8329>

```diff
From 4035927db2e82c8f12cb64764c77184ee60e8329 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Thu, 1 Oct 2026 23:55:10 +0300
Subject: [PATCH] SDL_os2messagebox.c: silence -Wpointer-to-int-cast.

---
 src/video/os2/SDL_os2messagebox.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/video/os2/SDL_os2messagebox.c b/src/video/os2/SDL_os2messagebox.c
index cbf86920b3e19..d52ec37d1f30c 100644
--- a/src/video/os2/SDL_os2messagebox.c
+++ b/src/video/os2/SDL_os2messagebox.c
@@ -272,7 +272,7 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
     pDlgItem->cChildren = 2 + cSDLBtnData; /* Ststic text + buttons. */
     /* Length of class name, if 0 then offClassname contains a WC_ value. */
     pDlgItem->cchClassName = 0;
- pDlgItem->offClassName = (USHORT)WC_FRAME;
+ pDlgItem->offClassName = (USHORT) ((ULONG) WC_FRAME);
     /* Length of text. */
     pDlgItem->cchText = cbTitle;
     pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to title text. */
@@ -326,7 +326,7 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
     pDlgItem->cChildren = 0;
     /* Length of class name, 0 - offClassname contains a WC_ constant. */
     pDlgItem->cchClassName = 0;
- pDlgItem->offClassName = (USHORT)WC_STATIC;
+ pDlgItem->offClassName = (USHORT) ((ULONG) WC_STATIC);
 
     pDlgItem->cchText = cbText;
     pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to the text. */
@@ -373,7 +373,7 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
     pDlgItem->fsItemStatus = 0;
     pDlgItem->cChildren = 0;
     pDlgItem->cchClassName = 0;
- pDlgItem->offClassName = (USHORT)WC_STATIC;
+ pDlgItem->offClassName = (USHORT) ((ULONG) WC_STATIC);
 
     pDlgItem->cchText = 3; /* 0xFF, low byte of the icon Id, high byte of icon Id. */
     pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to the Id. */
@@ -404,7 +404,7 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
         pDlgItem->fsItemStatus = 0;
         pDlgItem->cChildren = 0; /* No children. */
         pDlgItem->cchClassName = 0; /* 0 - offClassname is WC_ constant. */
- pDlgItem->offClassName = (USHORT)WC_BUTTON;
+ pDlgItem->offClassName = (USHORT) ((ULONG) WC_BUTTON);
 
         pszBtnText = OS2_UTF8ToSys(pSDLBtnData[ulIdx].text);
         cbBtnText = (!pszBtnText)? 1 : (SDL_strlen(pszBtnText) + 1);

```
