Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: UNREFERENCED_PARAMETER on apple

$
0
0
That makes sense, personally I find the macro a better method of self documenting code than the inline comment, which is why I have the macro in my cross platform code.

If you think it is a better fix to add the comment, I will do that, but I think it is cleaner ( as much as I dislike macros ) to continue to use the macro and/or to rename the macro to something Casablanca specific.

Lastly, the following code snippet will still produce a warning in xcode on release builds
bool success = SomeFunction();
MY_CUSTOM_ASSERT_MACRO_THAT_IS_A_NOOP_IN_A_RELASE_BUILD(success);
success; // unreferenced parameter
Changing the last line to:
(void) success; // unreferenced parameter
will remove the warning, but it seems less readable to me to add (void) varname; in place of the macro

In short I would rather put an ifndef before the macro, and/or rename the macro unless you strongly disagree with that answer.

Thoughts?

Viewing all articles
Browse latest Browse all 4845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>