Hi,

> I'm not sure how to actually help with the issue of making `int_fd`
> more discoverable. The only idea I've got is a ClangTidy check to
> complain about variables of type `int` named `fd` and other similar
> common names for file descriptors such as `socket`.

I was wondering about this as well.

It seems like we already provide a pretty comprehensive set of stout
library functions to create file descriptors. As an example, I see
`net::socket`, so user code directly calling `::socket` seems not like
something we'd want and we should rather add missing functionality to
our library functions than completely avoid them. If we use wrappers it
should be trivial to catch undesirable use of unwrapped functions given
some list of wrapper functions. We have an existing ticket to create
such a check, https://issues.apache.org/jira/browse/MESOS-5105; please
feel to add interesting wrapper functions to it.

We might also want to consider making `int_ft` a tighter type so that
e.g., conversions to `int` require explicit user action. That might
throw another wrench into too careless work.


Cheers,

Benjamin

Reply via email to