Opened 15 months ago

#187 new defect

Compilation fails with clang on Mac OS X in attribute_map.cpp

Reported by: omamce Owned by: ymipsl
Priority: major Component: XIOS
Version: 2.5 Keywords:
Cc:

Description

Platform : Mac OS X. Seen on Intel Mac (Olivier Marti) and M1 Mac (Sébastien Masson)

Compiler: clang 14.0.0

File : src/attribute_map.cpp

Error :

rc/attribute_map.cpp:433:30: error: use of overloaded operator '-' is ambiguous (with operand types 'std::basic_ostream<char>::pos_type' (aka 'fpos<__mbstate_t>') and 'long')
             if (oss.tellp() - startPos > 90)
                 ~~~~~~~~~~~ ^ ~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:574:37: note: candidate function
    _LIBCPP_INLINE_VISIBILITY fpos  operator- (streamoff __off) const {fpos __t(*this); __t -= __off; return __t;}

Solution :
Change all occurence of if (oss.tellp() - startPos > 90)
By : if ( (long)oss.tellp() - startPos > 90)

Correction succesfully tested on Irène Skylake and Irène AMD (TGCC)

Change History (0)

Note: See TracTickets for help on using tickets.