Bug 1952241 - nsProfileLock.cpp: Silent warning ‘*this.nsProfileLock::mHaveLock’ is used uninitialized r=profiles-reviewers,mossop

Differential Revision: https://phabricator.services.mozilla.com/D241602
This commit is contained in:
Sylvestre Ledru
2025-03-17 08:33:34 +00:00
parent 28e06b1d69
commit 99721f3e6d

View File

@@ -534,7 +534,12 @@ nsresult nsProfileLock::Lock(nsIFile* aProfileDir,
nsresult nsProfileLock::Unlock(bool aFatalSignal) {
nsresult rv = NS_OK;
#pragma GCC diagnostic push
/* Bug 1952241: Ignore uninitialized warning for mHaveLock.
Seems to be a false positive with gcc */
#pragma GCC diagnostic ignored "-Wuninitialized"
if (mHaveLock) {
#pragma GCC diagnostic pop
#if defined(XP_WIN)
if (mLockFileHandle != INVALID_HANDLE_VALUE) {
CloseHandle(mLockFileHandle);