Hello,

indeed. mico/assert.h is included inside CORBA.h which is not the best
and pollutes user code with MICO assert. It might be interesting to see
object files sizes change when MICO's assert is used and when the std
assert is used as comment in mico/assert.h suggests some dramatic
differences. Do you care to do such test on your platform?

Thanks,
Karel

On 07/29/10 21:29, Felipe Magno de Almeida wrote:
> Hello,
> 
> I see that mico redefines assert macro with something specific. I hope
> I'm missing something, but I don't think this should be done, because
> it can lead to One Definition Rule violations, which causes undefined
> behavior.
> For example:
> 
> -- a.h --
> 
> inline void foo(int x)
> {
>   assert(x != 0);
> }
> 
> -- a.cpp --
> 
> #include "a.h"
> 
> void bar()
> {
>   foo(1);
> }
> 
> -- b.cpp --
> 
> #include <CORBA.h>
> #include "a.h"
> 
> void my_bar()
> {
>   foo(1);
> }
> 
> -- --
> 
> And we have multiple implementations of foo which are different after
> preprocessing.
> Also, I don't see why mico should have the responsability to address
> assert's for code outside its own.
> If mico wants to optimize its assertions, it should define a
> MICO_ASSERT macro that does whatever it wants it to do.
> 
> 
> Regards,


-- 
Karel Gardas                  kgar...@objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Mico-devel mailing list
Mico-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mico-devel

Reply via email to