| Summary: | Some warnings compiling SDL_android_main.c | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Sylvain <sylvain.becker> |
| Component: | main | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | philipp.wiesemann |
| Version: | 2.0.4 | ||
| Hardware: | All | ||
| OS: | Android (All) | ||
The warnings for "-Wundef" should have been fixed here: https://hg.libsdl.org/SDL/rev/623c40e8fd65 The header file was changed (instead of "SDL_android_main.c") because this prevents the same problem to show up for other platform's "main.c" files someday. Thanks, the "undef" warnings are now fixed.
Only remains the warning for the prototype declaration of "nativeInit":
/src/main/android/SDL_android_main.c:20:23:
warning: no previous prototype for function 'Java_org_libsdl_app_SDLActivity_nativeInit' [-Wmissing-prototypes]
JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject array)
^
The warning for "-Wmissing-prototypes" should have been fixed here: https://hg.libsdl.org/SDL/rev/136b3507f669 Thanks! Yes this is fixed, thanks. |
The file "SDL_android_main.c" has to be included in user's project, but it compiles with warnings. The compilation does not depends on SDL warning flags, but on user's flags. Mines have "-Wundef" and "-Wmissing-prototypes" Can be quickly solved by adding in the file "SDL_android_main.c". #define TARGET_OS_IPHONE 0 #define __native_client__ 0 #define __EMSCRIPTEN__ 0 #define SDL_BUILDING_WINRT 0 #define __PSP__ 0 + prototype of "nativeInit". Or, there are probably better ways Here's the log: Compile thumb : main <= SDL_android_main.c In file included from src/main/android/SDL_android_main.c:4: In file included from src/main/android/../../SDL_internal.h:24: src/main/android/../../dynapi/SDL_dynapi.h:46:5: warning: 'TARGET_OS_IPHONE' is not defined, evaluates to 0 [-Wundef] #if TARGET_OS_IPHONE || __native_client__ || __EMSCRIPTEN__ /* probably not useful on iOS, NACL or Emscripten. */ ^ src/main/android/../../dynapi/SDL_dynapi.h:46:25: warning: '__native_client__' is not defined, evaluates to 0 [-Wundef] #if TARGET_OS_IPHONE || __native_client__ || __EMSCRIPTEN__ /* probably not useful on iOS, NACL or Emscripten. */ ^ src/main/android/../../dynapi/SDL_dynapi.h:46:46: warning: '__EMSCRIPTEN__' is not defined, evaluates to 0 [-Wundef] #if TARGET_OS_IPHONE || __native_client__ || __EMSCRIPTEN__ /* probably not useful on iOS, NACL or Emscripten. */ ^ src/main/android/../../dynapi/SDL_dynapi.h:48:7: warning: 'SDL_BUILDING_WINRT' is not defined, evaluates to 0 [-Wundef] #elif SDL_BUILDING_WINRT /* probaly not useful on WinRT, given current .dll loading restrictions */ ^ src/main/android/../../dynapi/SDL_dynapi.h:50:7: warning: '__PSP__' is not defined, evaluates to 0 [-Wundef] #elif __PSP__ ^ src/main/android/SDL_android_main.c:20:23: warning: no previous prototype for function 'Java_org_libsdl_app_SDLActivity_nativeInit' [-Wmissing-prototypes] JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject array)