[PATCH] static analysis support for posix file desccriptor APIs
Joseph Myers
joseph@codesourcery.com
Tue Jun 21 21:18:07 GMT 2022
On Tue, 21 Jun 2022, David Malcolm via Gcc wrote:
> Joseph: is the target hook the way to go with this? Would it look
> something like:
>
> DEFHOOK (fd_access_mode, "FIXME", int (int))
>
> taking the build configuration's O_ access mode, and returning the
> target configurations's access mode (so e.g fd_access_mode (O_RDONLY)
> would return the target's int) ?
I think it would probably take the GCC-specific READ_WRITE, READ_ONLY,
WRITE_ONLY you suggested, rather than the host's O_*. (Consider that it
might make sense in future to have checks for other O_* flags, some of
which might not be supported on the host.)
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Gcc
mailing list