Closed Bug 1571830 Opened 7 years ago Closed 7 years ago

Tremendous amounts of warning spam when building with icecc

Categories

(Toolkit :: Preferences, task)

task
Not set
normal

Tracking

()

RESOLVED WORKSFORME

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.

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: nobody → continuation

When you compile with icecc, it inlines all macros, so you get a
tremendous amount of spam related to tautologies.

I don't know if this is the right place for this, but it fixes the spam.

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.

See Also: → 1571855

njn said he fixed this in the code, so this warning should be no longer present.

Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WORKSFORME
Attachment #9083449 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: