Noisy warnings with Apple LLVM version 6.1.0 #540

Open
opened 2026-10-05 04:28:38 +02:00 by adam · 0 comments
Owner
$ clang --version
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.4.0
Thread model: posix
[...]
Building core object IRCNetwork...
src/IRCNetwork.cpp:647:1155: warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare]
  do { bool bUserExited = false; do { bool bGlobalExited = false; do { CModules& GMods = CZNC::Get().GetModules(); CUser* pOldGUser = GMods.GetUser(); CIRCNetwork* pOldGNetwork = GMods.GetNetwork(); CClient* pOldGClient = GMods.GetClient(); GMods.SetUser(m_pUser); GMods.SetNetwork(this); GMods.SetClient(nullptr); if (GMods.OnPrivBufferPlayLine2(*pClient, sLine, BufLine.GetTime())) { GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); *&bGlobalExited = true; } GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); } while (false); if (bGlobalExited) { *&bUserExited = true; break; } if (m_pUser != nullptr) { CModules& UMods = m_pUser->GetModules(); CIRCNetwork* pOldUNetwork = UMods.GetNetwork(); CClient* pOldUClient = UMods.GetClient(); UMods.SetNetwork(this); UMods.SetClient(nullptr); if (UMods.OnPrivBufferPlayLine2(*pClient, sLine, BufLine.GetTime())) { UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); *&bUserExited = true; } UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); } } while (false); if (bUserExited) { *&bContinue = true; break; } if (this != nullptr) { CModules& NMods = this->GetModules(); CClient* pOldNClient = NMods.GetClient(); NMods.SetClient(nullptr); if (NMods.OnPrivBufferPlayLine2(*pClient, sLine, BufLine.GetTime())) { NMods.SetClient(pOldNClient); *&bContinue = true; } NMods.SetClient(pOldNClient); } } while (false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ^~~~    ~~~~~~~
src/IRCNetwork.cpp:894:1072: warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare]
 do { bool bUserExited = false; do { bool bGlobalExited = false; do { CModules& GMods = CZNC::Get().GetModules(); CUser* pOldGUser = GMods.GetUser(); CIRCNetwork* pOldGNetwork = GMods.GetNetwork(); CClient* pOldGClient = GMods.GetClient(); GMods.SetUser(m_pUser); GMods.SetNetwork(this); GMods.SetClient(nullptr); if (GMods.OnJoining(*pChan)) { GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); *&bGlobalExited = true; } GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); } while (false); if (bGlobalExited) { *&bUserExited = true; break; } if (m_pUser != nullptr) { CModules& UMods = m_pUser->GetModules(); CIRCNetwork* pOldUNetwork = UMods.GetNetwork(); CClient* pOldUClient = UMods.GetClient(); UMods.SetNetwork(this); UMods.SetClient(nullptr); if (UMods.OnJoining(*pChan)) { UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); *&bUserExited = true; } UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); } } while (false); if (bUserExited) { *&bReturn = true; break; } if (this != nullptr) { CModules& NMods = this->GetModules(); CClient* pOldNClient = NMods.GetClient(); NMods.SetClient(nullptr); if (NMods.OnJoining(*pChan)) { NMods.SetClient(pOldNClient); *&bReturn = true; } NMods.SetClient(pOldNClient); } } while (false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ^~~~    ~~~~~~~
src/IRCNetwork.cpp:905:1085: warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare]
  do { bool bUserExited = false; do { bool bGlobalExited = false; do { CModules& GMods = CZNC::Get().GetModules(); CUser* pOldGUser = GMods.GetUser(); CIRCNetwork* pOldGNetwork = GMods.GetNetwork(); CClient* pOldGClient = GMods.GetClient(); GMods.SetUser(m_pUser); GMods.SetNetwork(this); GMods.SetClient(nullptr); if (GMods.OnTimerAutoJoin(*pChan)) { GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); *&bGlobalExited = true; } GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); } while (false); if (bGlobalExited) { *&bUserExited = true; break; } if (m_pUser != nullptr) { CModules& UMods = m_pUser->GetModules(); CIRCNetwork* pOldUNetwork = UMods.GetNetwork(); CClient* pOldUClient = UMods.GetClient(); UMods.SetNetwork(this); UMods.SetClient(nullptr); if (UMods.OnTimerAutoJoin(*pChan)) { UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); *&bUserExited = true; } UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); } } while (false); if (bUserExited) { *&bFailed = true; break; } if (this != nullptr) { CModules& NMods = this->GetModules(); CClient* pOldNClient = NMods.GetClient(); NMods.SetClient(nullptr); if (NMods.OnTimerAutoJoin(*pChan)) { NMods.SetClient(pOldNClient); *&bFailed = true; } NMods.SetClient(pOldNClient); } } while (false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ^~~~    ~~~~~~~
src/IRCNetwork.cpp:1206:1087: warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare]
 do { bool bUserExited = false; do { bool bGlobalExited = false; do { CModules& GMods = CZNC::Get().GetModules(); CUser* pOldGUser = GMods.GetUser(); CIRCNetwork* pOldGNetwork = GMods.GetNetwork(); CClient* pOldGClient = GMods.GetClient(); GMods.SetUser(m_pUser); GMods.SetNetwork(this); GMods.SetClient(nullptr); if (GMods.OnIRCConnecting(pIRCSock)) { GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); *&bGlobalExited = true; } GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); } while (false); if (bGlobalExited) { *&bUserExited = true; break; } if (m_pUser != nullptr) { CModules& UMods = m_pUser->GetModules(); CIRCNetwork* pOldUNetwork = UMods.GetNetwork(); CClient* pOldUClient = UMods.GetClient(); UMods.SetNetwork(this); UMods.SetClient(nullptr); if (UMods.OnIRCConnecting(pIRCSock)) { UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); *&bUserExited = true; } UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); } } while (false); if (bUserExited) { *&bAbort = true; break; } if (this != nullptr) { CModules& NMods = this->GetModules(); CClient* pOldNClient = NMods.GetClient(); NMods.SetClient(nullptr); if (NMods.OnIRCConnecting(pIRCSock)) { NMods.SetClient(pOldNClient); *&bAbort = true; } NMods.SetClient(pOldNClient); } } while (false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ^~~~    ~~~~~~~
4 warnings generated.
Building core object User...
src/User.cpp:476:603: warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare]
 do { bool bGlobalExited = false; do { CModules& GMods = CZNC::Get().GetModules(); CUser* pOldGUser = GMods.GetUser(); CIRCNetwork* pOldGNetwork = GMods.GetNetwork(); CClient* pOldGClient = GMods.GetClient(); GMods.SetUser(this); GMods.SetNetwork(nullptr); GMods.SetClient(nullptr); if (GMods.OnAddNetwork(*pNetwork, sErrorRet)) { GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); *&bGlobalExited = true; } GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); } while (false); if (bGlobalExited) { *&bCancel = true; break; } if (this != nullptr) { CModules& UMods = this->GetModules(); CIRCNetwork* pOldUNetwork = UMods.GetNetwork(); CClient* pOldUClient = UMods.GetClient(); UMods.SetNetwork(nullptr); UMods.SetClient(nullptr); if (UMods.OnAddNetwork(*pNetwork, sErrorRet)) { UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); *&bCancel = true; } UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); } } while (false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ^~~~    ~~~~~~~
src/User.cpp:508:596: warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare]
  do { bool bGlobalExited = false; do { CModules& GMods = CZNC::Get().GetModules(); CUser* pOldGUser = GMods.GetUser(); CIRCNetwork* pOldGNetwork = GMods.GetNetwork(); CClient* pOldGClient = GMods.GetClient(); GMods.SetUser(this); GMods.SetNetwork(nullptr); GMods.SetClient(nullptr); if (GMods.OnDeleteNetwork(*pNetwork)) { GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); *&bGlobalExited = true; } GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); } while (false); if (bGlobalExited) { *&bCancel = true; break; } if (this != nullptr) { CModules& UMods = this->GetModules(); CIRCNetwork* pOldUNetwork = UMods.GetNetwork(); CClient* pOldUClient = UMods.GetClient(); UMods.SetNetwork(nullptr); UMods.SetClient(nullptr); if (UMods.OnDeleteNetwork(*pNetwork)) { UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); *&bCancel = true; } UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); } } while (false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ^~~~    ~~~~~~~
2 warnings generated.
[...]

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/24343846-noisy-warnings-with-apple-llvm-version-6-1-0?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github).
``` $ clang --version Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.4.0 Thread model: posix ``` ``` [...] Building core object IRCNetwork... src/IRCNetwork.cpp:647:1155: warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare] do { bool bUserExited = false; do { bool bGlobalExited = false; do { CModules& GMods = CZNC::Get().GetModules(); CUser* pOldGUser = GMods.GetUser(); CIRCNetwork* pOldGNetwork = GMods.GetNetwork(); CClient* pOldGClient = GMods.GetClient(); GMods.SetUser(m_pUser); GMods.SetNetwork(this); GMods.SetClient(nullptr); if (GMods.OnPrivBufferPlayLine2(*pClient, sLine, BufLine.GetTime())) { GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); *&bGlobalExited = true; } GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); } while (false); if (bGlobalExited) { *&bUserExited = true; break; } if (m_pUser != nullptr) { CModules& UMods = m_pUser->GetModules(); CIRCNetwork* pOldUNetwork = UMods.GetNetwork(); CClient* pOldUClient = UMods.GetClient(); UMods.SetNetwork(this); UMods.SetClient(nullptr); if (UMods.OnPrivBufferPlayLine2(*pClient, sLine, BufLine.GetTime())) { UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); *&bUserExited = true; } UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); } } while (false); if (bUserExited) { *&bContinue = true; break; } if (this != nullptr) { CModules& NMods = this->GetModules(); CClient* pOldNClient = NMods.GetClient(); NMods.SetClient(nullptr); if (NMods.OnPrivBufferPlayLine2(*pClient, sLine, BufLine.GetTime())) { NMods.SetClient(pOldNClient); *&bContinue = true; } NMods.SetClient(pOldNClient); } } while (false); ^~~~ ~~~~~~~ src/IRCNetwork.cpp:894:1072: warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare] do { bool bUserExited = false; do { bool bGlobalExited = false; do { CModules& GMods = CZNC::Get().GetModules(); CUser* pOldGUser = GMods.GetUser(); CIRCNetwork* pOldGNetwork = GMods.GetNetwork(); CClient* pOldGClient = GMods.GetClient(); GMods.SetUser(m_pUser); GMods.SetNetwork(this); GMods.SetClient(nullptr); if (GMods.OnJoining(*pChan)) { GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); *&bGlobalExited = true; } GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); } while (false); if (bGlobalExited) { *&bUserExited = true; break; } if (m_pUser != nullptr) { CModules& UMods = m_pUser->GetModules(); CIRCNetwork* pOldUNetwork = UMods.GetNetwork(); CClient* pOldUClient = UMods.GetClient(); UMods.SetNetwork(this); UMods.SetClient(nullptr); if (UMods.OnJoining(*pChan)) { UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); *&bUserExited = true; } UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); } } while (false); if (bUserExited) { *&bReturn = true; break; } if (this != nullptr) { CModules& NMods = this->GetModules(); CClient* pOldNClient = NMods.GetClient(); NMods.SetClient(nullptr); if (NMods.OnJoining(*pChan)) { NMods.SetClient(pOldNClient); *&bReturn = true; } NMods.SetClient(pOldNClient); } } while (false); ^~~~ ~~~~~~~ src/IRCNetwork.cpp:905:1085: warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare] do { bool bUserExited = false; do { bool bGlobalExited = false; do { CModules& GMods = CZNC::Get().GetModules(); CUser* pOldGUser = GMods.GetUser(); CIRCNetwork* pOldGNetwork = GMods.GetNetwork(); CClient* pOldGClient = GMods.GetClient(); GMods.SetUser(m_pUser); GMods.SetNetwork(this); GMods.SetClient(nullptr); if (GMods.OnTimerAutoJoin(*pChan)) { GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); *&bGlobalExited = true; } GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); } while (false); if (bGlobalExited) { *&bUserExited = true; break; } if (m_pUser != nullptr) { CModules& UMods = m_pUser->GetModules(); CIRCNetwork* pOldUNetwork = UMods.GetNetwork(); CClient* pOldUClient = UMods.GetClient(); UMods.SetNetwork(this); UMods.SetClient(nullptr); if (UMods.OnTimerAutoJoin(*pChan)) { UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); *&bUserExited = true; } UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); } } while (false); if (bUserExited) { *&bFailed = true; break; } if (this != nullptr) { CModules& NMods = this->GetModules(); CClient* pOldNClient = NMods.GetClient(); NMods.SetClient(nullptr); if (NMods.OnTimerAutoJoin(*pChan)) { NMods.SetClient(pOldNClient); *&bFailed = true; } NMods.SetClient(pOldNClient); } } while (false); ^~~~ ~~~~~~~ src/IRCNetwork.cpp:1206:1087: warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare] do { bool bUserExited = false; do { bool bGlobalExited = false; do { CModules& GMods = CZNC::Get().GetModules(); CUser* pOldGUser = GMods.GetUser(); CIRCNetwork* pOldGNetwork = GMods.GetNetwork(); CClient* pOldGClient = GMods.GetClient(); GMods.SetUser(m_pUser); GMods.SetNetwork(this); GMods.SetClient(nullptr); if (GMods.OnIRCConnecting(pIRCSock)) { GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); *&bGlobalExited = true; } GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); } while (false); if (bGlobalExited) { *&bUserExited = true; break; } if (m_pUser != nullptr) { CModules& UMods = m_pUser->GetModules(); CIRCNetwork* pOldUNetwork = UMods.GetNetwork(); CClient* pOldUClient = UMods.GetClient(); UMods.SetNetwork(this); UMods.SetClient(nullptr); if (UMods.OnIRCConnecting(pIRCSock)) { UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); *&bUserExited = true; } UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); } } while (false); if (bUserExited) { *&bAbort = true; break; } if (this != nullptr) { CModules& NMods = this->GetModules(); CClient* pOldNClient = NMods.GetClient(); NMods.SetClient(nullptr); if (NMods.OnIRCConnecting(pIRCSock)) { NMods.SetClient(pOldNClient); *&bAbort = true; } NMods.SetClient(pOldNClient); } } while (false); ^~~~ ~~~~~~~ 4 warnings generated. Building core object User... src/User.cpp:476:603: warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare] do { bool bGlobalExited = false; do { CModules& GMods = CZNC::Get().GetModules(); CUser* pOldGUser = GMods.GetUser(); CIRCNetwork* pOldGNetwork = GMods.GetNetwork(); CClient* pOldGClient = GMods.GetClient(); GMods.SetUser(this); GMods.SetNetwork(nullptr); GMods.SetClient(nullptr); if (GMods.OnAddNetwork(*pNetwork, sErrorRet)) { GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); *&bGlobalExited = true; } GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); } while (false); if (bGlobalExited) { *&bCancel = true; break; } if (this != nullptr) { CModules& UMods = this->GetModules(); CIRCNetwork* pOldUNetwork = UMods.GetNetwork(); CClient* pOldUClient = UMods.GetClient(); UMods.SetNetwork(nullptr); UMods.SetClient(nullptr); if (UMods.OnAddNetwork(*pNetwork, sErrorRet)) { UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); *&bCancel = true; } UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); } } while (false); ^~~~ ~~~~~~~ src/User.cpp:508:596: warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare] do { bool bGlobalExited = false; do { CModules& GMods = CZNC::Get().GetModules(); CUser* pOldGUser = GMods.GetUser(); CIRCNetwork* pOldGNetwork = GMods.GetNetwork(); CClient* pOldGClient = GMods.GetClient(); GMods.SetUser(this); GMods.SetNetwork(nullptr); GMods.SetClient(nullptr); if (GMods.OnDeleteNetwork(*pNetwork)) { GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); *&bGlobalExited = true; } GMods.SetUser(pOldGUser); GMods.SetNetwork(pOldGNetwork); GMods.SetClient(pOldGClient); } while (false); if (bGlobalExited) { *&bCancel = true; break; } if (this != nullptr) { CModules& UMods = this->GetModules(); CIRCNetwork* pOldUNetwork = UMods.GetNetwork(); CClient* pOldUClient = UMods.GetClient(); UMods.SetNetwork(nullptr); UMods.SetClient(nullptr); if (UMods.OnDeleteNetwork(*pNetwork)) { UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); *&bCancel = true; } UMods.SetNetwork(pOldUNetwork); UMods.SetClient(pOldUClient); } } while (false); ^~~~ ~~~~~~~ 2 warnings generated. [...] ``` ## <bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/24343846-noisy-warnings-with-apple-llvm-version-6-1-0?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github). </bountysource-plugin> <!-- github-sync-id:95057624 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#540