[SERVER-15182] Clang 3.5 reports error: 'this' pointer cannot be null in well defined C++ Created: 09/Sep/14  Updated: 11/Nov/16  Resolved: 19/Sep/14

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: 2.7.6
Fix Version/s: 2.7.7

Type: Bug Priority: Major - P3
Reporter: Tyler Brock Assignee: Tyler Brock
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

This actually is an error as clang reports it.

In file included from src/mongo/client/dbclientinterface.h:1388:
src/mongo/client/dbclientcursor.h:122:40: error: 'this' pointer cannot be null in well-defined C++ code; pointer may
      be assumed to always convert to true [-Werror,-Wundefined-bool-conversion]
        bool isDead() const { return  !this || cursorId == 0; }



 Comments   
Comment by Andrey [ 11/Nov/16 ]

Hi Andrew Morrow,

Thanks a lot. With option --disable-warnings-as-errors, all works fine

Comment by Andrew Morrow (Inactive) [ 10/Nov/16 ]

You can pass the option --disable-warnings-as-errors to SCons to change the errors into warnings. If that doesn't help, please open a new server ticket with the errors that remained.

Comment by Andrey [ 10/Nov/16 ]

What should I do, if I want to build mongo version 2.6.11 on machine with next options:?

  • Operating System - MAC OS X El Captain 10.11.6
  • Scons - 2.5.1
  • Python - 2.7.12 'final' 0 version
  • Clang - Apple LLVM version 7.3.0 (clang-703.0.31)
Comment by Githook User [ 19/Sep/14 ]

Author:

{u'username': u'TylerBrock', u'name': u'Tyler Brock', u'email': u'tyler.brock@gmail.com'}

Message: SERVER-15182 remove tautological checks for "this" == NULL
Branch: master
https://github.com/mongodb/mongo/commit/db59c175c736609970b52f91e30fc2277e22b25b

Generated at Thu Feb 08 03:37:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.