← Back to team overview

zorba-coders team mailing list archive

[Bug 980463] Re: Using type_info::name() wrong

 

** Changed in: zorba
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/980463

Title:
  Using type_info::name() wrong

Status in Zorba - The XQuery Processor:
  Fix Released

Bug description:
  In class_serializer.h,  the definition of the CHECK_CLASS_NAME macro:

    #define CHECK_CLASS_NAME(class_name) \
    if (ar.is_serializing_out() && !ar.is_serialize_base_class()) \
    { \
      assert(strstr(typeid(*this).name(), #class_name)); \
    }

  The string returned by type_info::name() is implementation-dependent
  and has no guarantees about its content or format. In this case, you
  can not legitimately test to see, for some class type C, if
  typeid(C).name() contains the string literal "C".

  However, you can legitimately compare two name() strings for equality.
  The above should be rewritten as:

      assert(::strcmp(typeid(*this).name(), typeid(class_name).name())
  == 0);

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/980463/+subscriptions


References