Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Generated methods that return BOOL should return NO instead of 0. #8

seanm opened this Issue · 5 comments

2 participants


AnalysisTool ( which in turn uses the llvm static analyzer generates warnings for mogenerated code. ex:

  • (BOOL)primitiveIsLeafValue { NSNumber *result = [self primitiveIsLeaf]; return result ? [result boolValue] : 0; }

It warns "coercion from 'int' to 'BOOL' may alter its value". Of course, there isn't really anything wrong with the code above, but the warning could be easily silenced by changing that 0 to a NO. That would fix it because the definition of NO includes a cast to BOOL.

This warning is useful in other situations but all these false positives are generating a lot of noise.


This is a little hard to deal with since we'd need to special-case BOOLs in the machine.m template


:( That's a pity. Combined with bug #2, I'm starting to have the impression that mogenerator is difficult to expand upon... :(


It's not difficult to expound on, it just has to deal with asymmetry between Obj-C types and their NSValue/NSNumber method names. I haven't written a mapper since I haven't needed it for myself yet.


Thanks! Closing.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.