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

Fix Xcode compiler warning: Implicit conversion loses integer precision:... #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

richrad
Copy link

@richrad richrad commented Nov 12, 2013

... 'NSUInteger' (aka 'unsigned long') to 'int'

…on: 'NSUInteger' (aka 'unsigned long') to 'int'
@jstart
Copy link

jstart commented Apr 7, 2014

👍

1 similar comment
@YSDC
Copy link

YSDC commented Nov 7, 2014

+1

@ewanmellor
Copy link
Contributor

+1, but this is also covered by PR #39.

@tblank555
Copy link

Simply silencing this one with a cast may not be the right call. - [NSData length] returns an NSUInteger, which is either an unsigned int (on 32 bit systems) or an unsigned long (on 64 bit systems). This value is being passed to a libxml function that is expecting an int, which I believe is always a 32 bit number.

So if it's a possibility that the length of the data exceeds 2^32-1, then there should be some code that checks that case. Is that a possibility? Seems like it'd be a pretty crazy edge case if it is...

After understanding that concern, I say we just cast it and get rid of this annoying warning :)

+1

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 this pull request may close these issues.

None yet

5 participants