Hi there, To be able to apply clang-tidy to our project, I need the Toolkit to compile with Clang. Hereby, I ran into the following four errors, which are all of the same type. Would be great if this could be fixed with the next update:
1. C:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v22.1.0\Source\Common\XTPXMLHelpers.h(207): error: enumeration previously declared with fixed underlying type 207 | enum tagDOMNodeType | ^ C:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v22.1.0\Source\Common\XTPXMLHelpers.h(80): message: previous declaration is here 80 | XTP_FORWARD_ENUM(tagDOMNodeType); | ^
2. C:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v22.1.0\Source\Common\XTPXMLHelpers.h(740): error: enumeration previously declared with fixed underlying type 740 | enum tagXMLEMEM_TYPE | ^ C:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v22.1.0\Source\Common\XTPXMLHelpers.h(144): message: previous declaration is here 144 | XTP_FORWARD_ENUM(tagXMLEMEM_TYPE); |
3. C:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v22.1.0\Source\GridControl\XTPGridADO.h(1369): error: enumeration previously declared with fixed underlying type 1369 | enum PositionEnum | ^ C:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v22.1.0\Source\GridControl\XTPGridADO.h(1071): message: previous declaration is here 1071 | XTP_FORWARD_ENUM(PositionEnum); | ^
4. C:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v22.1.0\Source\GridControl\XTPGridADO.h(1422): error: enumeration previously declared with fixed underlying type 1422 | enum SearchDirectionEnum | ^ C:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v22.1.0\Source\GridControl\XTPGridADO.h(1073): message: previous declaration is here 1073 | XTP_FORWARD_ENUM(SearchDirectionEnum); |
Related to that, I found this information: https://timsong-cpp.github.io/cppwp/n4140/dcl.enum#3" rel="nofollow - https://timsong-cpp.github.io/cppwp/n4140/dcl.enum#3
The issue here seems to be the definition of the XTP_FORWARD_ENUM, found in Source\Common\XTPMacros.h: # if (1700 <= _MSC_VER) # define XTP_DECLARE_ENUM(enumName) enum enumName : int # else # define XTP_DECLARE_ENUM(enumName) enum enumName # endif # define XTP_FORWARD_ENUM(enumName) XTP_DECLARE_ENUM(enumName)
My compiler is a lot newer than 1700, thus the enums are forward declared with int datatype. Afterwards though, they are redeclared without the int datatype, which is causing the error.
My solution would be to change the definition of those four enums (the solution applies to all four of them, thus tagDOMNodeType, tagXMLEMEM_TYPE, PositionEnum, SearchDirectionEnum) from:
enum PositionEnum { ... }
to:
# if (1700 <= _MSC_VER) enum PositionEnum : int # else enum PositionEnum # endif { ... }
This fixes the compilation for me.
Thanks in advance.
|