New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hb-iter-private.hh:75:3: error: bad implicit conversion operator for 'Iter<const int *>' with HB 1.8.5 #1127
Comments
I like it to be implicit though. What's bad about it? I'm going to make a new release later today, if you want to wait. |
Ie. I want the iterators to be used in for loops like: |
Or is that too much magic? |
Hmm, this check has been in our code base for about 3 years now (bug 1153348). We do allow for a MOZ_IMPLICIT annotation on lines we don't want to mark as explicit, but that obviously seems a tad non-ideal for upstream libraries 😃. I believe I can opt HarfBuzz out of that specific static analysis check as well, but that seems like the only real option here if using explicit isn't what you want. |
We haven't started using that idiom yet. I understand why it's desirable to ban it. I think I'm fine making it explicit. |
Released 1.8.6 with this change. |
Some of our compilers (Oracle Studio and Apple gcc 4.2) do not like explicit on non-constructors :(. I think I'll revert this. Do you think you can handle it on your side? |
Yeah, we can work around it.
…On Thu, Aug 9, 2018, 4:00 AM Behdad Esfahbod ***@***.***> wrote:
Reopened #1127 <#1127>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1127 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADfdv4wZElUh4JpUY4Y9z4Cx5TIELMrsks5uO-wAgaJpZM4Vw81o>
.
|
Actually, I think I'll take care of this by enabling the explicit only in C++11 or later. Reading https://en.cppreference.com/w/cpp/language/explicit reminds me believe that if and for statements perform an explicit cast to bool, so I was wrong that we would need to write "for (...; bool(it); ...)" if I add explicit. You don't need to do anything. I'll fix this. |
Hi, I'm looking at updating HarfBuzz in Firefox and our clang static analysis checker is hitting the below errors:
I can confirm that adding an explicit to that line resolves the errors.
The text was updated successfully, but these errors were encountered: