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

Already on GitHub? Sign in to your account

Compile error with Xcode 4.6, for Mac target #54

Closed
snej opened this Issue Jan 30, 2013 · 1 comment

Comments

Projects
None yet
1 participant
Contributor

snej commented Jan 30, 2013

CocoaHTTPServer fails to build for Mac OS targets using Xcode 4.6. It looks like Clang's control-flow analysis has been improved and it now detects an uninitialized-variable error in GCDAsyncSocket:


CocoaHTTPServer/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m:4214:6: error: variable 'hasBytesAvailable' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
        if ([self usingCFStreamForTLS])
            ^~~~~~~~~~~~~~~~~~~~~~~~~~
CocoaHTTPServer/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m:4275:7: note: uninitialized use occurs here
        if ((hasBytesAvailable == NO) && ([preBuffer availableBytes] == 0))
             ^~~~~~~~~~~~~~~~~

I think this will not be a real bug because it doesn't look as though usingCFStreamForTLS will ever be set when not building for iOS, but I'm not certain.

I haven't looked at the CocoaAsyncSocket project to see if they've fixed the bug there.

Contributor

snej commented Feb 5, 2013

I've sent a pull request with the fix -- see #57.

@snej snej closed this Feb 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment