We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5500

Summary: Windows CMake build broken for GCC/Clang due to violation of -Werror=declaration-after-statement
Product: SDL Reporter: Brandon DeRosier <x>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sezeroz
Version: HG 2.1   
Hardware: All   
OS: Windows (All)   
Attachments: Mercurial patch to fix build

Description Brandon DeRosier 2021-01-24 12:02:44 UTC
Created attachment 4699 [details]
Mercurial patch to fix build

Attached a quick mercurial patch to fix.

src\video\windows\SDL_windowsevents.c:438:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]

The included `CMakeLists.txt` intentionally passes `-Werror=declaration-after-statement` if the compiler supports it. `SDL_windowsevents.c:438` is the only location currently violating this. (Broken a few hours ago by https://hg.libsdl.org/SDL/changeset/14778)
Comment 1 Ozkan Sezer 2021-01-24 13:30:38 UTC
Edited the commit message a bit and pushed the patch as
https://hg.libsdl.org/SDL/rev/395cc2864bb7

Thanks.