On 03/06/2018 12:38 PM, Nash, George wrote:
> I am not a fan of the VERIFY_SUCCESS macro. It is not prefixed with the OC_ 
> which should be used for all iotivity macros to help prevent name collisions 
> with macros from external projects.  Even with the prefix I think this is an 
> internal macro that should not be exposed to the public APIs. I have seen 
> some code recently that used the VERIFY_SUCCESS macro in sample code. The 
> only reason it is building is because it is linking with internal headers. 
> (not 100% sure about the non-public API statement)
> We definitely should check where it is defined in multiple places and see if 
> we can consolidate those definitions to a single definition.  If we cannot 
> consolidate to one definition I would rename one of the usages.
> Finally if nothing else works the #ifdef #undef // macro #endif option should 
> be applied.
> This is all opinion and I am open to other suggestions.
> George Nash

the VERY_FUNNY (oops, VERIFY_SUCCESS) stuff should only be used for unit
tests, no?  that style of macro would be pretty ugly for non-test code
anyway as there tend to be embeded returns/goto-exits/etc in at least
some of the series.  Production code, and even examples, would want to
handle errors, not just bail.
iotivity-dev mailing list

Reply via email to