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 3517 - Compiler warnings with gcc -Wstrict-prototypes
Summary: Compiler warnings with gcc -Wstrict-prototypes
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: All Linux
: P2 minor
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-12 17:23 UTC by felix
Modified: 2016-12-26 10:13 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 felix 2016-12-12 17:23:13 UTC
Compiling even a simple SDL2 'hello world' program with gcc -Wstrict-prototypes (GCC 6.2.1) results in warnings like:

/usr/include/SDL2/SDL_gamecontroller.h:143:1: attention : function declaration isn’t a prototype [-Wstrict-prototypes]
 extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings();
 ^~~~~~

It seems there is a missing 'void' between the parentheses.

A quick grep over the source tree reveals:

$ grep 'extern .*();' **/*.h
include/SDL_atomic.h:162:extern DECLSPEC void SDLCALL SDL_MemoryBarrierRelease();
include/SDL_atomic.h:163:extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquire();
include/SDL_system.h:99:extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv();
include/SDL_system.h:109:extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity();
include/SDL_system.h:124:extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath();
include/SDL_system.h:133:extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState();
include/SDL_system.h:141:extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath();
src/core/linux/SDL_fcitx.h:36:extern void SDL_Fcitx_PumpEvents();
src/core/linux/SDL_ibus.h:52:extern void SDL_IBus_PumpEvents();
src/core/linux/SDL_ime.h:30:extern SDL_bool SDL_IME_Init();
src/core/linux/SDL_ime.h:31:extern void SDL_IME_Quit();
src/core/linux/SDL_ime.h:33:extern void SDL_IME_Reset();
src/core/linux/SDL_ime.h:36:extern void SDL_IME_PumpEvents();
src/core/windows/SDL_windows.h:60:extern BOOL WIN_IsWindowsVistaOrGreater();
src/haptic/SDL_syshaptic.h:65:extern int SDL_SYS_NumHaptics();
src/joystick/SDL_sysjoystick.h:70:extern int SDL_SYS_NumJoysticks();
src/joystick/SDL_sysjoystick.h:73:extern void SDL_SYS_JoystickDetect();
src/render/opengl/SDL_shaders_gl.h:37:extern GL_ShaderContext * GL_CreateShaderContext();
src/thread/SDL_systhread.h:58:extern SDL_TLSData *SDL_SYS_GetTLSData();
src/thread/SDL_thread_c.h:85:extern SDL_TLSData *SDL_Generic_GetTLSData();
src/video/haiku/SDL_bkeyboard.h:33:extern void BE_InitOSKeymap();
src/video/uikit/SDL_uikitmessagebox.h:25:extern SDL_bool UIKit_ShowingMessageBox();
src/video/uikit/SDL_uikitopengles.h:36:extern void UIKit_GL_RestoreCurrentContext();
src/video/winrt/SDL_winrtevents_c.h:78:extern void WINRT_CycleXAMLThread();
Xcode-iOS/Demos/src/common.h:10:extern double updateDeltaTime();

There may be other places, I haven't looked thoroughly.
Comment 1 Sam Lantinga 2016-12-26 10:13:33 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/88943d97bf00