You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Karen Huang (JIRA)" <ji...@apache.org> on 2017/03/24 08:16:41 UTC

[jira] [Created] (MESOS-7300) Mesos failed to build on Windows due to error C2440: 'return': cannot convert from 'Error' to 'bool'

Karen Huang created MESOS-7300:
----------------------------------

             Summary: Mesos failed to build on Windows due to error C2440: 'return': cannot convert from 'Error' to 'bool'
                 Key: MESOS-7300
                 URL: https://issues.apache.org/jira/browse/MESOS-7300
             Project: Mesos
          Issue Type: Bug
          Components: build
         Environment: Windows Server 2012 R2 + VS2015 Update 3
            Reporter: Karen Huang
            Priority: Blocker


I try to build Mesos (master branch revision 322300f) with VS2015 Update 3 on Windows. It failed to build with the following error:
D:\Mesos\src\3rdparty\stout\include\stout/os/windows/stat.hpp(41): error C2440: 'return': cannot convert from 'Error' to 'bool' (compiling source file D:\Mesos\src\3rdparty\libprocess\src\time.cpp) [D:\Mesos\build_x64\3rdparty\libprocess\src\process-0.0.1.vcxproj]
D:\Mesos\src\3rdparty\stout\include\stout/os/windows/stat.hpp(59): error C2440: 'return': cannot convert from 'Error' to 'bool' (compiling source file D:\Mesos\src\3rdparty\libprocess\src\time.cpp) [D:\Mesos\build_x64\3rdparty\libprocess\src\process-0.0.1.vcxproj]

This issue starts to be reproduce form master branch revision "82e4077" (https://github.com/apache/mesos/commit/82e4077ceb40e84c2796be43f1448eec0bfd7c69#diff-76a72473075f57f8d0d3b3bf6f150672)

I presume this is a issue in your source code. The function "inline bool isdir(  const std::string& path, const FollowSymlink follow = FOLLOW_SYMLINK)"
needs a bool type return value. But the return value type of "Error("Non-following stat not supported for '" + path + "'")" is not bool.

In D:\Mesos\src\3rdparty\stout\include\stout\os\windows\stat.hpp file:
inline bool isdir(
    const std::string& path,
    const FollowSymlink follow = FOLLOW_SYMLINK)
{
  struct _stat s;
  if (follow == DO_NOT_FOLLOW_SYMLINK) {
      return Error("Non-following stat not supported for '" + path + "'");
  }
  if (::_stat(path.c_str(), &s) < 0) {
    return false;
  }
  return S_ISDIR(s.st_mode);
}

In D:\Mesos\src\3rdparty\stout\include\stout\errorbase.hpp file:
class Error
{
public:
  explicit Error(const std::string& _message) : message(_message) {}

  const std::string message;
};



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)