Menu

#483 Macro naming conflicts with C++ standard

unspecified
open
nobody
API (62)
1
2022-08-10
2020-12-20
No

The naming of a macro with a leading underscore conflicts with reserved identifiers in the C++ standard. Such names are reserved for use by the standard implementation (see CppReference).

For example, see [discussion:1899709664], which reports conflict between macro _RTTI, defined in "include/owl/private/defs.h", and a standard header (which by chance uses this name internally).

Note: This issue has been eliminated in Owlet, our experimental branch, by using the prefix "OWL_" on all macros defined by the library [r2202]. The obsolete macro _RTTI, referred to above, was removed in [r2164].

Workaround: Undefine any conflicting macros before including standard headers. For example:

#undef _RTTI
#include <any>

Related

Bugs: #539
Commit: [r2164]
Commit: [r2202]
Discussion: 1899709664
Discussion: Problem with std::any and OWL's _RTTI macro

Discussion

  • Vidar Hasfjord

    Vidar Hasfjord - 2021-02-21
    • Group: 7 --> unspecified
     
  • Vidar Hasfjord

    Vidar Hasfjord - 2022-08-10

    If we should want to fix this issue for _RTTI in particular, here is a patch applicable to OWLNext 6.44.18.6045, that removes _RTTI from the source code altogether, as it is not used (RTTI is required to be enabled in the compiler settings, which is the default anyway).

     

Log in to post a comment.