It seems that even in release builds you should be checking the error code, otherwise foo() should just return void since you assume it can't fail in release builds, and instead foo() should have the assert internally.
-john On Wednesday, April 02, 2008, at 05:04PM, "Richard Somers" <[EMAIL PROTECTED]> wrote: >I use a function which returns an error code. The error variable is >used in a NSAssert. > > int error = foo(); > NSAssert(error == 0, @"We have an assertion failure!"); > >The NSAssert complies out in the release configuration by using the >preprocessor macro NS_BLOCK_ASSERTIONS. This results in a warning: >unused variable "error". > >Do most programmers turn off the unused variable warnings or do >something else to get this to work. > >Regards, Richard > >_______________________________________________ > >Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > >Please do not post admin requests or moderator comments to the list. >Contact the moderators at cocoa-dev-admins(at)lists.apple.com > >Help/Unsubscribe/Update your Subscription: >http://lists.apple.com/mailman/options/cocoa-dev/newlin_john%40mac.com > >This email sent to [EMAIL PROTECTED] > > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]