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 2908 - Fix clang warnings
Summary: Fix clang warnings
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 trivial
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-14 20:48 UTC by Simon Deschenes
Modified: 2015-06-15 02:22 UTC (History)
1 user (show)

See Also:


Attachments
The patch (1.62 KB, patch)
2015-03-14 20:48 UTC, Simon Deschenes
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Deschenes 2015-03-14 20:48:16 UTC
Created attachment 2063 [details]
The patch

My build system still shows warning as errors.

This patch fixes the warnings clang outputs.

The first warning says that the member named instances can never be false (or NULL) as it is a static array, and we should check for instances[index] which we do anyway.

The second and third warning says the that the type specifier for printing is ld but the type is long long. Putting the platform agnostic SInt64 fixes the problem as it chooses the correct type depending on the platform, either long or long long.
Comment 1 Sam Lantinga 2015-06-15 02:22:11 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/306e09b65660