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 4980

Summary: Build fails for SDL_kmsdrm*.c
Product: SDL Reporter: Malte Kießling <mkalte>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: build config
patch

Description Malte Kießling 2020-02-13 21:54:23 UTC
Created attachment 4210 [details]
build config

Since https://hg.libsdl.org/SDL/rev/045f218436fe / bug 4966 i cannot build SDL anymore. The error i get is, essentially, caused by -Werror=declaration-after-statement in SDL_kmsdrmvideo.c and SDL_kmsdrmopengles.c  

I have attached the build config (cmake output) and a failed partial build (to keep the log down). I tried this directly on the revision and on tip, the error is the same.

Interestingly, a build with clang  goes through, as -Werror=declaration-after-statement is not set. 

I will also attatch a patch in a moment
Comment 1 Malte Kießling 2020-02-13 21:59:41 UTC
Created attachment 4211 [details]
patch

quick fix, moving the declarations up. 
I hopefully kept all non-trivial assignments where they were. 
Patch is created from tip.
Comment 2 Sam Lantinga 2020-02-15 00:17:32 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL/rev/9761858bd6a3