boostorg / process

Boost Process
https://www.boost.org/libs/process
118 stars 118 forks source link

Compilation fails with '/permissive-' in Boost 1.75.0 when "boost/process/group.hpp" is included #224

Open vaishnavkatiyar opened 3 years ago

vaishnavkatiyar commented 3 years ago

The following error is generated when the command cl /I.\.. /EHsc /permissive- Source.cpp is used:

Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29112 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

Source.cpp
.\..\boost/process/detail/windows/handles.hpp(146): error C2039: 'GetHandleInformation': is not a member of 'boost::winapi'
.\..\boost/winapi/dll.hpp(190): note: see declaration of 'boost::winapi'
.\..\boost/process/detail/windows/handles.hpp(146): note: This diagnostic occurred in the compiler generated function 'void boost::process::detail::windows::limit_handles_::on_setup(Executor &) const'
.\..\boost/process/detail/windows/handles.hpp(147): error C2039: 'HANDLE_FLAG_INHERIT_': is not a member of 'boost::winapi'
.\..\boost/winapi/dll.hpp(190): note: see declaration of 'boost::winapi'
.\..\boost/process/detail/windows/handles.hpp(147): note: This diagnostic occurred in the compiler generated function 'void boost::process::detail::windows::limit_handles_::on_setup(Executor &) const'
.\..\boost/process/detail/windows/handles.hpp(158): error C2039: 'SetHandleInformation': is not a member of 'boost::winapi'
.\..\boost/winapi/dll.hpp(190): note: see declaration of 'boost::winapi'
.\..\boost/process/detail/windows/handles.hpp(158): note: This diagnostic occurred in the compiler generated function 'void boost::process::detail::windows::limit_handles_::on_setup(Executor &) const'
.\..\boost/process/detail/windows/handles.hpp(158): error C2039: 'HANDLE_FLAG_INHERIT_': is not a member of 'boost::winapi'
.\..\boost/winapi/dll.hpp(190): note: see declaration of 'boost::winapi'
.\..\boost/process/detail/windows/handles.hpp(158): note: This diagnostic occurred in the compiler generated function 'void boost::process::detail::windows::limit_handles_::on_setup(Executor &) const'
.\..\boost/process/detail/windows/handles.hpp(165): error C2039: 'SetHandleInformation': is not a member of 'boost::winapi'
.\..\boost/winapi/dll.hpp(190): note: see declaration of 'boost::winapi'
.\..\boost/process/detail/windows/handles.hpp(165): note: This diagnostic occurred in the compiler generated function 'void boost::process::detail::windows::limit_handles_::on_error(Executor &,const std::error_code &) const'
.\..\boost/process/detail/windows/handles.hpp(165): error C2039: 'HANDLE_FLAG_INHERIT_': is not a member of 'boost::winapi'
.\..\boost/winapi/dll.hpp(190): note: see declaration of 'boost::winapi'
.\..\boost/process/detail/windows/handles.hpp(165): note: This diagnostic occurred in the compiler generated function 'void boost::process::detail::windows::limit_handles_::on_error(Executor &,const std::error_code &) const'
.\..\boost/process/detail/windows/handles.hpp(165): error C2039: 'HANDLE_FLAG_INHERIT_': is not a member of 'boost::winapi'
.\..\boost/winapi/dll.hpp(190): note: see declaration of 'boost::winapi'
.\..\boost/process/detail/windows/handles.hpp(165): note: This diagnostic occurred in the compiler generated function 'void boost::process::detail::windows::limit_handles_::on_error(Executor &,const std::error_code &) const'
.\..\boost/process/detail/windows/handles.hpp(172): error C2039: 'SetHandleInformation': is not a member of 'boost::winapi'
.\..\boost/winapi/dll.hpp(190): note: see declaration of 'boost::winapi'
.\..\boost/process/detail/windows/handles.hpp(172): note: This diagnostic occurred in the compiler generated function 'void boost::process::detail::windows::limit_handles_::on_sucess(Executor &) const'
.\..\boost/process/detail/windows/handles.hpp(172): error C2039: 'HANDLE_FLAG_INHERIT_': is not a member of 'boost::winapi'
.\..\boost/winapi/dll.hpp(190): note: see declaration of 'boost::winapi'
.\..\boost/process/detail/windows/handles.hpp(172): note: This diagnostic occurred in the compiler generated function 'void boost::process::detail::windows::limit_handles_::on_sucess(Executor &) const'
.\..\boost/process/detail/windows/handles.hpp(172): error C2039: 'HANDLE_FLAG_INHERIT_': is not a member of 'boost::winapi'
.\..\boost/winapi/dll.hpp(190): note: see declaration of 'boost::winapi'
.\..\boost/process/detail/windows/handles.hpp(172): note: This diagnostic occurred in the compiler generated function 'void boost::process::detail::windows::limit_handles_::on_sucess(Executor &) const'

Source.cpp:

#define _WIN32_WINDOWS
#include <boost/process/group.hpp>

int main() {
    getchar();
    return 0;
}

Including the header boost/winapi/handle_info.hpp in boost/process/detail/windows/handles.hpp resolves the above issue.

Tradias commented 2 years ago

Seems like a duplicate of https://github.com/boostorg/process/issues/183