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

Warnings and Analysis warnings #3

Open
GerTeunis opened this issue Feb 14, 2010 · 5 comments
Open

Warnings and Analysis warnings #3

GerTeunis opened this issue Feb 14, 2010 · 5 comments

Comments

@GerTeunis
Copy link

First of all, great work on aqxmlparser, a real win for my project.
I try to create as clean as code I can and can't stand warnings and analysis warnings.
Sadly aqxmlparser does throw some of them, when I compile I get the following warning and analysis warnings:

Analysis

/Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:1138:9 Incorrect decrement of the reference count of an object is not owned at this point by the caller

/Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:1187:3 Value stored to 'saxHandler' is never read

Warnings

/Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:115:0 /Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:115: warning: 'NSObject' may not respond to '-stream:handleEvent:'

/Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:115:0 /Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:115: warning: (Messages without a matching method signature

/Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:153:0 /Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:153: warning: 'NSObject' may not respond to '-stream:handleEvent:'

/Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:159:0 /Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:159: warning: 'NSObject' may not respond to '-stream:handleEvent:'

/Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:1098:0 /Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:1098: warning: class 'AQXMLParser' does not implement the 'NSStreamDelegate' protocol

/Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:1228:0 /Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:1228: warning: incompatible Objective-C types 'struct AQXMLParser *', expected 'struct NSXMLParser *' when passing argument 1 of 'parser:parseErrorOccurred:' from distinct Objective-C type

/Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:1332:0 /Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:1332: warning: incompatible Objective-C types 'struct AQXMLParser *', expected 'struct NSXMLParser *' when passing argument 1 of 'parser:didStartMappingPrefix:toURI:' from distinct Objective-C type

/Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:1354:0 /Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:1354: warning: incompatible Objective-C types 'struct AQXMLParser *', expected 'struct NSXMLParser *' when passing argument 1 of 'parser:didEndMappingPrefix:' from distinct Objective-C type

@GerTeunis
Copy link
Author

I've added the latest version from git now.

Fix 1: add to AQXMLParser
@interface AQXMLParser : NSObject

Still warnings about the NSXMLParser AQXMLParser mismatch
/Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:965:0 /Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:965: warning: incompatible Objective-C types 'struct AQXMLParser *', expected 'struct NSXMLParser *' when passing argument 1 of 'parser:parseErrorOccurred:' from distinct Objective-C type

/Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:1072:0 /Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:1072: warning: incompatible Objective-C types 'struct AQXMLParser *', expected 'struct NSXMLParser *' when passing argument 1 of 'parser:didStartMappingPrefix:toURI:' from distinct Objective-C type

/Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:1094:0 /Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:1094: warning: incompatible Objective-C types 'struct AQXMLParser *', expected 'struct NSXMLParser *' when passing argument 1 of 'parser:didEndMappingPrefix:' from distinct Objective-C type

I use AQXMLParserDelegate in my setDelegate method

@AlanQuatermain
Copy link
Owner

It sounds like you're declaring your delegate class to implement the NSXMLParserDelegate protocol rather than the AQXMLParserDelegate protocol, would that be correct? I haven't seen these warnings in a long time now, not since copying the NS version to my own header file and changing all the NS* classes to AQ*.

@GerTeunis
Copy link
Author

Thank you for your reply.

I use on class which uses the AQXMLParserDelegate: copy paste:
@interface NZB : NSObject <NSCoding, AQXMLParserDelegate> {
NSString *uiTitle;
NSString *nzbFileName;
[...]

And get warning:
/Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:965:0 /Users/gerteunis/Documents/NZBVortex/Classes/XML/AQXMLParser.m:965: warning: incompatible Objective-C types 'struct AQXMLParser *', expected 'struct NSXMLParser *' when passing argument 1 of 'parser:parseErrorOccurred:' from distinct Objective-C type

Funny isn't it? Have absolutely no clue what I did wrong here.

@AlanQuatermain
Copy link
Owner

I'm scratching my head on this one too. Maybe #import the AQXMLParser header before Foundation.h? For whatever reason, the compiler is seeing the NSXMLParser version first, and so is comparing against that.

Overall I'm not inclined to worry about it— the same thing happens when calling -isEqual: and other methods implemented with different parameter types on different classes; the compiler can 'choose' to type against the one taking an NSDate, when really you're looking for the NSString version.

@GerTeunis
Copy link
Author

Whatever I do I do not seem to get them 'fixed'
No problem though; I am just ignoring them.

Thanks alan!

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