Fixed bug 3517 - Compiler warnings with gcc -Wstrict-prototypes

felix

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.
This commit is contained in:
Sam Lantinga committed 2016-12-26 02:12:21 -08:00
1 parent 9492492d5f
commit b4e069e7f8
18 files changed
+19 -19

No files matched your search

+1 -1
View File
@@ -41,7 +41,7 @@ extern "C" {
static SDL_Scancode keymap[KEYMAP_SIZE];
static int8 keystate[KEYMAP_SIZE];
void BE_InitOSKeymap() {
void BE_InitOSKeymap(void) {
for( uint i = 0; i < SDL_TABLESIZE(keymap); ++i ) {
keymap[i] = SDL_SCANCODE_UNKNOWN;
}
+1 -1
View File
@@ -30,7 +30,7 @@ extern "C" {
#include "../../../include/SDL_keyboard.h"
extern void BE_InitOSKeymap();
extern void BE_InitOSKeymap(void);
extern SDL_Scancode BE_GetScancodeFromBeKey(int32 bkey);
extern int8 BE_GetKeyState(int32 bkey);
extern void BE_SetKeyState(int32 bkey, int8 state);