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

Static Analysis #16

Open
isadon opened this issue Mar 13, 2015 · 1 comment
Open

Static Analysis #16

isadon opened this issue Mar 13, 2015 · 1 comment

Comments

@isadon
Copy link

isadon commented Mar 13, 2015

Hi,
I will be using your library on one of my iOS projects soon but have a been a bit worried because after running ios-ntp through AppCode's static analysis there are a lot of valid warnings. For example in various places an integer is return from a function that is supposed to return an unsigned integer. -- see GCDAsyncUdpSocket.m line 1663. Though it doesn't speak to whether the library works or not it would be great if you could fix the code up a bit in the hopes of maybe prevent any crashes or problems that may occur. See Appcode at https://www.jetbrains.com/objc/

Thanks

@gavineadie
Copy link
Collaborator

I agree that the type of a returned variable should match the defined function/method return type but, at least in the case you cite, (1) GCDAsyncUdpSocket.m is code from another library at https://github.com/robbiehanson/CocoaAsyncSocket and that class hasn't been touched for a year, and (2) the function in question (indexOfInterfaceAddr4) is not used anywhere in ios-ntp. The CocoaAsyncSocket code is so widely used that I suspect it is behaving correctly.

Of course, you are not restricted from correcting these type inconsistencies (and maybe pushing your work to Robbie), or from dropping out all the unused functions in your version of the code.

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

No branches or pull requests

2 participants