[SERVER-41071] convert all appearances of NULL in C++ code to nullptr Created: 09/May/19 Updated: 29/Oct/23 Resolved: 17/Jun/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | 4.3 Required |
| Fix Version/s: | 4.3.1 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Billy Donahue | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Sprint: | Dev Tools 2019-06-17 | ||||
| Participants: | |||||
| Linked BF Score: | 100 | ||||
| Description |
|
C's NULL has weaker type safety than C++11's nullptr. It's convertible to nullptr_t, but also to integer types (emitting a warning, but still). 2011 was a while ago. NULL is unnecessary vocabulary, and should be easy to globally replace. |
| Comments |
| Comment by Ratika Gandhi [ 18/Jul/19 ] | ||||||||||||
|
acm, should this be backported to 4.2? | ||||||||||||
| Comment by Githook User [ 19/Jun/19 ] | ||||||||||||
|
Author: {'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}Message: | ||||||||||||
| Comment by Githook User [ 17/Jun/19 ] | ||||||||||||
|
Author: {'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}Message: | ||||||||||||
| Comment by Githook User [ 17/Jun/19 ] | ||||||||||||
|
Author: {'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}Message: | ||||||||||||
| Comment by Githook User [ 14/Jun/19 ] | ||||||||||||
|
Author: {'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}Message: | ||||||||||||
| Comment by A. Jesse Jiryu Davis [ 14/Jun/19 ] | ||||||||||||
|
Yes, clang-modernize is now part of clang-tidy and it has an option for nullptr.
| ||||||||||||
| Comment by Andrew Morrow (Inactive) [ 09/May/19 ] | ||||||||||||
|
Could we use clang-modernize to do this for us? Does it have such a converter? |