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 - SDL_virtualjoystic.c: C90 compatibility broken: it won't build
Summary: SDL_virtualjoystic.c: C90 compatibility broken: it won't build
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.1
Hardware: All All
: P2 normal
Assignee: David Ludwig
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-16 16:28 UTC by Vitaly Novichkov
Modified: 2020-03-16 21:32 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!