[gnutls-devel] GnuTLS | New CI runner with clang combined ubsan+asan (!1151)
Development of GNU's TLS library
gnutls-devel at lists.gnutls.org
Thu Jan 23 17:54:34 CET 2020
Tim Rühsen commented on a discussion on lib/hello_ext.c: https://gitlab.com/gnutls/gnutls/merge_requests/1151#note_276085450
> int ret;
> hello_ext_ctx_st ctx;
>
> - msg &= GNUTLS_EXT_FLAG_SET_ONLY_FLAGS_MASK;
> + msg &= (gnutls_ext_flags_t) GNUTLS_EXT_FLAG_SET_ONLY_FLAGS_MASK;
No - we need enum type safety here. `gnutls_ext_flags_t` is a collection of some single bit values. `GNUTLS_EXT_FLAG_SET_ONLY_FLAGS_MASK` is *not* a `gnutls_ext_flags_t`. Since an enum has no fixed type (every compiler is free to use any integer type, signed or unsigned), we'll either need this cast *or* we have to make `GNUTLS_EXT_FLAG_SET_ONLY_FLAGS_MASK` a `gnutls_ext_flags_t`.
I chose the first possibility. If you like the second possibility more, I can change it (but fear it will become even more strange). Using unsigned int for `msg` doesn't really help here.
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/1151#note_276085450
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20200123/49e8df8f/attachment.html>
More information about the Gnutls-devel
mailing list