Tremendous amounts of warning spam when building with icecc
Categories
(Toolkit :: Preferences, task)
Tracking
()
People
(Reporter: mccr8, Assigned: mccr8)
References
Details
Attachments
(1 obsolete file)
The new static preferences system creates a tremendous amount of console warning spam, when compiled with Icecc. Icecc inlines macros before compilation. I think I basically get one of these warnings in every file that includes a preference header, for every preference. The output for a single preference is this:
0:49.16 /media/ssd/mc/obj-dbg.noindex/dist/include/mozilla/StaticPrefList_apz.h:323:138: warning: self-comparison always evaluates to false [-Wtautological-compare]
0:49.16 extern bool sVarCache_apz_keyboard_enabled_AtStartup; inline StripAtomic<bool> apz_keyboard_enabled_AtStartup() { if (UpdatePolicy::Once != UpdatePolicy::Once) { do { static_assert( mozilla::detail::AssertionConditionType<decltype(IsAtomic<bool>::value || NS_IsMainThread())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(IsAtomic<bool>::value || NS_IsMainThread()))), 0))) { MOZ_ReportAssertionFailure("IsAtomic<bool>::value || NS_IsMainThread()" " (" "Non-atomic static pref '" "apz.keyboard.enabled" "' being accessed on background thread by getter" ")", "/media/ssd/mc/obj-dbg.noindex/dist/include/mozilla/StaticPrefList_apz.h", 329); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT(" "IsAtomic<bool>::value || NS_IsMainThread()" ") (" "Non-atomic static pref '" "apz.keyboard.enabled" "' being accessed on background thread by getter" ")"); do { ((volatile int)__null) = 329; ::abort(); } while (false); } } while (false); return sVarCache_apz_keyboard_enabled_AtStartup; } MaybeInitOncePrefs(); return sVarCache_apz_keyboard_enabled_AtStartup; } inline const char* GetPrefName_apz_keyboard_enabled() { return "apz.keyboard.enabled"; } inline StripAtomic<bool> GetPrefDefault_apz_keyboard_enabled() { return true; }
Presumably the tautology is "if (UpdatePolicy::Once != UpdatePolicy::Once) ". The "being accessed on background thread by getter" part suggests that maybe this is due to something in StaticPrefListBegin.h, but I'm not sure where the inequality comes from.
Maybe the warning could be locally disabled? There's so much log spam it makes it very difficult to find the actual errors.
| Assignee | ||
Comment 1•7 years ago
|
||
One sort of fix to this I found is to put this in StaticPrefListBegin.h:
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-compare"
And this in StaticPrefListEnd.h:
#pragma clang diagnostic pop
| Assignee | ||
Updated•7 years ago
|
| Assignee | ||
Comment 2•7 years ago
|
||
When you compile with icecc, it inlines all macros, so you get a
tremendous amount of spam related to tautologies.
| Assignee | ||
Comment 3•7 years ago
|
||
I don't know if this is the right place for this, but it fixes the spam.
Comment 4•7 years ago
|
||
The real underlying problem is that icecc should know to pass the right flags to the compiler when it distributes, but doesn't. The right flags being -x c++-cpp-output. sccache doesn't have this problem.
| Assignee | ||
Comment 5•7 years ago
|
||
njn said he fixed this in the code, so this warning should be no longer present.
Updated•7 years ago
|
Description
•