** Changed in: zorba
       Status: In Progress => Fix Committed

You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.

  Using type_info::name() wrong

Status in Zorba - The XQuery Processor:
  Fix Committed

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:

Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to