Closed Bug 1633809 Opened 2 years ago Closed 2 years ago

Warnings spam while building Firefox with clang

Categories

(Core :: XPCOM, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox-esr68 --- unaffected
firefox75 --- unaffected
firefox76 --- unaffected
firefox77 --- fixed

People

(Reporter: miko, Assigned: sg)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Building on my Macbook gives me around 15k lines of warnings similar to:

 2:40.21 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/mozilla/NotNull.h:213:154: warning: nonnull parameter 'aBasePtr' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion]
 2:40.21  do { static_assert( mozilla::detail::AssertionConditionType<decltype(aBasePtr)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(aBasePtr))), 0))) { MOZ_ReportAssertionFailure("aBasePtr", "/Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/mozilla/NotNull.h", 213); AnnotateMozCrashReason("MOZ_ASSERT" "(" "aBasePtr" ")"); do { *((volatile int*)__null) = 213; ::abort(); } while (false); } } while (false);
 2:40.21                                                                                                                                                        ~ ^~~~~~~~
 2:40.21 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/nsTArray.h:2755:21: note: in instantiation of function template specialization 'mozilla::WrapNotNullUnchecked<nsIMutationObserver *>' requested here
 2:40.21     return mozilla::WrapNotNullUnchecked(
 2:40.21                     ^
 2:40.21 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/nsTObserverArray.h:187:12: note: in instantiation of function template specialization 'nsTArray<nsIMutationObserver *>::AppendElement<nsIMutationObserver *&>' requested here
 2:40.21     mArray.AppendElement(std::forward<Item>(aItem));
 2:40.21            ^
 2:40.21 /Users/miko/Code/mu/dom/base/nsINode.h:1053:27: note: in instantiation of function template specialization 'nsAutoTObserverArray<nsIMutationObserver *, 1>::AppendElement<nsIMutationObserver *&>' requested here
 2:40.21     s->mMutationObservers.AppendElement(aMutationObserver);
 2:40.21                           ^
 2:40.21 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/mozilla/NotNull.h:207:16: note: declared 'nonnull' here
 2:40.21 __attribute__((nonnull(1)))
 2:40.21                ^
 2:40.21 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/mozilla/NotNull.h:213:154: warning: nonnull parameter 'aBasePtr' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion]
 2:40.21  do { static_assert( mozilla::detail::AssertionConditionType<decltype(aBasePtr)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(aBasePtr))), 0))) { MOZ_ReportAssertionFailure("aBasePtr", "/Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/mozilla/NotNull.h", 213); AnnotateMozCrashReason("MOZ_ASSERT" "(" "aBasePtr" ")"); do { *((volatile int*)__null) = 213; ::abort(); } while (false); } } while (false);
 2:40.21                                                                                                                                                        ~ ^~~~~~~~
 2:40.21 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/nsTArray.h:2755:21: note: in instantiation of function template specialization 'mozilla::WrapNotNullUnchecked<regiondetails::Strip>' requested here
 2:40.21     return mozilla::WrapNotNullUnchecked(
 2:40.21                     ^
 2:40.21 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/nsRegion.h:112:13: note: in instantiation of function template specialization 'nsTArray<regiondetails::Strip>::AppendElement<regiondetails::Strip>' requested here
 2:40.21     mStrips.AppendElement(Strip{aRect.X(), aRect.XMost()});
 2:40.21             ^
 2:40.21 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/mozilla/NotNull.h:207:16: note: declared 'nonnull' here
 2:40.21 __attribute__((nonnull(1)))
 2:40.21                ^
 2:40.21 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/mozilla/NotNull.h:213:154: warning: nonnull parameter 'aBasePtr' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion]
 2:40.21  do { static_assert( mozilla::detail::AssertionConditionType<decltype(aBasePtr)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(aBasePtr))), 0))) { MOZ_ReportAssertionFailure("aBasePtr", "/Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/mozilla/NotNull.h", 213); AnnotateMozCrashReason("MOZ_ASSERT" "(" "aBasePtr" ")"); do { *((volatile int*)__null) = 213; ::abort(); } while (false); } } while (false);
 2:40.21                                                                                                                                                        ~ ^~~~~~~~
 2:40.21 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/nsTArray.h:2755:21: note: in instantiation of function template specialization 'mozilla::WrapNotNullUnchecked<regiondetails::Band>' requested here
 2:40.21     return mozilla::WrapNotNullUnchecked(
 2:40.21                     ^
 2:40.21 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/nsRegion.h:606:16: note: in instantiation of function template specialization 'nsTArray<regiondetails::Band>::AppendElement<regiondetails::Band>' requested here
 2:40.21           aOut.AppendElement(std::move(newBand));
 2:40.21                ^
 2:40.22 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/mozilla/NotNull.h:207:16: note: declared 'nonnull' here
 2:40.22 __attribute__((nonnull(1)))
 2:40.22                ^
 2:40.22 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/mozilla/NotNull.h:213:154: warning: nonnull parameter 'aBasePtr' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion]
 2:40.22  do { static_assert( mozilla::detail::AssertionConditionType<decltype(aBasePtr)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(aBasePtr))), 0))) { MOZ_ReportAssertionFailure("aBasePtr", "/Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/mozilla/NotNull.h", 213); AnnotateMozCrashReason("MOZ_ASSERT" "(" "aBasePtr" ")"); do { *((volatile int*)__null) = 213; ::abort(); } while (false); } } while (false);
 2:40.22                                                                                                                                                        ~ ^~~~~~~~
 2:40.22 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/nsTArray.h:2755:21: note: in instantiation of function template specialization 'mozilla::WrapNotNullUnchecked<nsCOMPtr<nsIObserver> >' requested here
 2:40.22     return mozilla::WrapNotNullUnchecked(
 2:40.22                     ^
 2:40.22 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/mozilla/dom/Document.h:318:18: note: in instantiation of function template specialization 'nsTArray<nsCOMPtr<nsIObserver> >::AppendElement<nsIObserver *&>' requested here
 2:40.22       mObservers.AppendElement(aObserver);
 2:40.22                  ^
 2:40.22 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/mozilla/NotNull.h:207:16: note: declared 'nonnull' here
 2:40.22 __attribute__((nonnull(1)))
 2:40.22                ^
 2:40.22 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/mozilla/NotNull.h:213:154: warning: nonnull parameter 'aBasePtr' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion]
 2:40.22  do { static_assert( mozilla::detail::AssertionConditionType<decltype(aBasePtr)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(aBasePtr))), 0))) { MOZ_ReportAssertionFailure("aBasePtr", "/Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/mozilla/NotNull.h", 213); AnnotateMozCrashReason("MOZ_ASSERT" "(" "aBasePtr" ")"); do { *((volatile int*)__null) = 213; ::abort(); } while (false); } } while (false);
 2:40.22                                                                                                                                                        ~ ^~~~~~~~
 2:40.22 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/nsTArray.h:2755:21: note: in instantiation of function template specialization 'mozilla::WrapNotNullUnchecked<mozilla::dom::Document::SelectorCacheKey *>' requested here
 2:40.22     return mozilla::WrapNotNullUnchecked(
 2:40.22                     ^
 2:40.22 /Users/miko/Code/mu/obj-ff-dbg-dist/dist/include/nsExpirationTracker.h:167:16: note: in instantiation of function template specialization 'nsTArray<mozilla::dom::Document::SelectorCacheKey *>::AppendElement<mozilla::dom::Document::SelectorCacheKey *&>' requested here

This was regressed by 1628715 - Part 12: Add WrapNotNullUnchecked for NotNull<T*>.
There is already a suppression for warnings, but it only works for GCC1.

Assignee: nobody → sgiesecke
No longer blocks: 1628715
Regressed by: 1628715
Pushed by sgiesecke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/878dc21be211
Suppress -Wpointer-bool-conversion in WrapNotNullUnchecked. r=miko
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77

Set release status flags based on info from the regressing bug 1628715

You need to log in before you can comment on or make changes to this bug.