Stop violating C and C++ reserved names

  • Hi,

    The last snapshot (1281) of kopano core does not build memory.hpp on OpenBSD/amd64 because ctype ends up being included (I think through cwtype) which already define _U and the like (used for templates in the header file).

    According to the C and C++ standard names starting with underscore uppercase letter are reserved. Is there anything wrong with using T instead of _T, U instead of _U and so on and so forth? I see no problem with that on my system.

    For a full diff checkout this link. Can this be applied to the official tree? (Actually now that I look at it there is also __p and other stuff that this patch does not fix. Sigh.)

    Paul Irofti

  • Yes, you are right that _ are reserved identifiers (and we should fix it).
    Does it cause a build error in your environment?

  • Yes it does. Comes from ctype.h as mentioned in my original post.

  • This post is deleted!

  • Some 1550 lines with instances of reserved identifiers have been edited (particularly the short ones also used by ctype). There are more left, but unless there are (still) compile errors, I would prefer doing them in the next devel cycle.

  • Hi,

    Thanks for your help with this issue. If your changes included the ones I posted in my diff then it surely compiles on OpenBSD and there will be one less patch (58 total) needed for Kopano in my tree.


Log in to reply