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 2702 - Non-literal format string
Summary: Non-literal format string
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: 2.0.3
Hardware: ARM Android (All)
: P2 minor
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-23 22:24 UTC by John McFarlane
Modified: 2014-08-24 07:06 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 John McFarlane 2014-08-23 22:24:39 UTC
When building SDL2 for Android I get this single compiler error:

[armeabi-v7a] Compile thumb  : SDL2 <= SDL_test_assert.c
jni/SDL/src/test/SDL_test_assert.c: In function 'SDLTest_Assert':
jni/SDL/src/test/SDL_test_assert.c:59:5: error: format not a string literal and no format arguments [-Werror=format-security]
     SDL_assert((SDLTest_AssertCheck(assertCondition, logMessage)));
     ^

The simplest fix is to change the above line as follows:

    SDL_assert((SDLTest_AssertCheck(assertCondition, "%s", logMessage)));
Comment 1 Sam Lantinga 2014-08-24 07:06:05 UTC
This is fixed in Mercurial, thanks!