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 2586 - SDL update hg:8820(0e935d5b193a) triggers -Wformat-security warning, breaking Android build
Summary: SDL update hg:8820(0e935d5b193a) triggers -Wformat-security warning, breaking...
Status: RESOLVED FIXED
Alias: None
Product: SDL_image
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: x86_64 Android (All)
: P2 blocker
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-15 11:01 UTC by roaldfernandez
Modified: 2014-06-15 20:17 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 roaldfernandez 2014-06-15 11:01:03 UTC
SDL update hg:8820(0e935d5b193a) triggers -Wformat-security warning in the SDL_image 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_image/Android.mk file.

This affects SDL_image, SDL_ttf.

This does not affect SDL, SDL_mixer and SDL_net, as they use SDL_SetError in a way that lets the compiler inspect the passed string content, avoiding this warning.

PS: I'll post a duplicate bug report to SDL_ttf, as this breaks both builds.

Cheers,
Roald Fernandez

Change-diff of fix:
diff -r 175c0200df0a Android.mk
--- a/Android.mk	Sun May 11 11:21:10 2014 -0400
+++ b/Android.mk	Sun Jun 15 12:55:51 2014 +0200
@@ -126,4 +126,6 @@
 
 LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
 
+LOCAL_DISABLE_FORMAT_STRING_CHECKS=true
+
 include $(BUILD_SHARED_LIBRARY)
Comment 1 Sam Lantinga 2014-06-15 20:17:55 UTC
I fixed the code that was triggering the warnings.  Thanks!
https://hg.libsdl.org/SDL_image/rev/48116d511e5d