Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building for 64-bit architecture cause warnings about precision loss and format arguments #4

Closed
gogopair opened this issue Feb 1, 2014 · 1 comment · Fixed by #5

Comments

@gogopair
Copy link
Contributor

gogopair commented Feb 1, 2014

Change project architecture to include 64-bit and build, see warning:

Implicit conversion loses integer precision: 'long' to 'int'
Implicit conversion loses integer precision: 'NSUInteger' (aka 'unsigned long') to 'int'
Implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int'
Implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int'
Implicit conversion loses integer precision: 'NSUInteger' (aka 'unsigned long') to 'int'
Implicit conversion loses integer precision: 'NSUInteger' (aka 'unsigned long') to 'int'
Implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int'
Values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead
Values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead
Values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead
Values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead
@gogopair
Copy link
Contributor Author

gogopair commented Feb 1, 2014

Example:

MagicPie/MagicPieLayer/NSMutableArray+pieEx.m:50:51: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        int insertIdx = [indexes[i] integerValue] - decrementIdx;
            ~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
MagicPie/MagicPieLayer/NSMutableArray+pieEx.m:69:24: warning: implicit conversion loses integer precision: 'NSUInteger' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
    int indexesCount = self.count;
        ~~~~~~~~~~~~   ^~~~~~~~~~
MagicPie/MagicPieLayer/NSMutableArray+pieEx.m:71:25: warning: implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int' [-Wshorten-64-to-32]
        int unusedIdx = unusedIdxNum.integerValue;
            ~~~~~~~~~   ^~~~~~~~~~~~~~~~~~~~~~~~~
MagicPie/MagicPieLayer/NSMutableArray+pieEx.m:73:23: warning: implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int' [-Wshorten-64-to-32]
            int idx = [self[i] integerValue];
                ~~~   ^~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant