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 5038

Summary: SDL_virtualjoystic.c: C90 compatibility broken: it won't build
Product: SDL Reporter: Vitaly Novichkov <admin>
Component: joystickAssignee: David Ludwig <dll>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: All   
OS: All   

Description Vitaly Novichkov 2020-03-16 16:28:48 UTC
Hello!

Just now I was found that the recent state of SDL won't be built because of C11 trick was been used when C90 is required:

https://semaphoreci.com/wohlstand/sdl-mixer-x/branches/master/builds/258

```
/home/runner/SDL-Mixer-X/build-debug/external/AudioCodecs/src/AudioCodecs-build/external/SDL2/src/SDL2HG/src/joystick/virtual/SDL_virtualjoystick.c: In function ‘VIRTUAL_JoystickUpdate’:
/home/runner/SDL-Mixer-X/build-debug/external/AudioCodecs/src/AudioCodecs-build/external/SDL2/src/SDL2HG/src/joystick/virtual/SDL_virtualjoystick.c:356:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < hwdata->naxes; ++i) {

```
Comment 1 David Ludwig 2020-03-16 21:24:29 UTC
Hello Vitaly,

Thanks for the heads up!  A potential fix is up on hg.libsdl.org now, at https://hg.libsdl.org/SDL/rev/40c8eec2d15c

If that doesn't work, let me know and I'll take another look at it.
Comment 2 Vitaly Novichkov 2020-03-16 21:32:35 UTC
I did re-run the build, now it works, thanks!