boostorg / boostorg/process

posix/executor.hpp: write_error() narrowing conversion - Warning

Open
#235 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
145
Forks
151
PR merge metrics
No merged PRs in 30d

Description

Line 156 of boost_1_78_0/boost/process/detail/posix/executor.hpp was modified to use "auto" for the string length.
`const auto len = std::strlen(msg);`
The data[2] line however expects int.
```
int data[2] = {ec.value(), len + 1};
::write(_pipe_sink, &data[0], sizeof(int) * 2);

```
This leads to a narrowing warning like
`boost_1_78_0/boost/process/detail/posix/executor.hpp:156:40: error: narrowing conversion of '(((long unsigned int)len) + 1)' from 'long unsigned int' to 'int' inside { } [-Werror=narrowing]`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.