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 2587

Summary: SDL update hg:8820(0e935d5b193a) triggers -Wformat-security warning, breaking Android build
Product: SDL_ttf Reporter: roaldfernandez
Component: miscAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P2 CC: icculus, philipp.wiesemann
Version: unspecified   
Hardware: x86_64   
OS: Android (All)   

Description roaldfernandez 2014-06-15 11:08:23 UTC
SDL update hg:8820(0e935d5b193a) triggers -Wformat-security warning in the SDL_ttf usage of SDL_SetError. This breaks the android NDK build, as it has a default -Werror=format-security flag set.

The default -Werror=format-security is set by [ANDROID-NDK]/build/core/build-binary.mk

A possible solution is disabling this -Werror flag, by setting LOCAL_DISABLE_FORMAT_STRING_CHECKS=true in a the [SDL_ttf]/Android.mk file.

This affects SDL_image, SDL_ttf.

Duplicate bug report for SDL_image: https://bugzilla.libsdl.org/show_bug.cgi?id=2586

Cheers,
Roald

Change-diff of fix:
diff -r 997babb2f547 Android.mk
--- a/Android.mk	Sun May 11 11:20:09 2014 -0400
+++ b/Android.mk	Sun Jun 15 13:07:43 2014 +0200
@@ -63,4 +63,6 @@
 
 LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
 
+LOCAL_DISABLE_FORMAT_STRING_CHECKS=true
+
 include $(BUILD_SHARED_LIBRARY)
Comment 1 Philipp Wiesemann 2016-01-17 16:35:27 UTC
This might have been fixed here (like in bug 2586):
https://hg.libsdl.org/SDL_ttf/rev/73118378dae8
Comment 2 Ryan C. Gordon 2017-06-07 17:07:10 UTC
Yeah, I think this got fixed a while ago.

--ryan.