protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

Consistently use nullptr instead of NULL

Open maguro opened this issue 8 years ago • 4 comments

There are many places where NULL is used where nullptr can and should be used. The pointer literal has been around for quite a while and is already in use in the code base.

maguro avatar May 05 '18 14:05 maguro

Hey, I am a beginner here and was wondering if changing every NULL assigned to a pointer variable to nullptr will solve the problem. If so, how can i go about doing so. Any help regarding the same is appreciated.

vamsibulusu avatar Jun 12 '18 09:06 vamsibulusu

@vamsibulusu A good place to start would be in the src/google/protobuf/stubs directory. A simple search-and-replace of NULL for nullptr would probably work well. Other than the stubs directory I'm not sure if it would be a good idea to change everything at once, though--the problem is that within Google we have an internal version of the codebase that we sync back and forth with this repo on GitHub, and it might create a lot of merge conflicts. (Our internal version doesn't share the stubs/ directory, so that part is fine.)

acozzette avatar Jun 20 '18 18:06 acozzette

Didnt see any PR for this. I went ahead and created one https://github.com/google/protobuf/pull/5010

batradhruv avatar Aug 06 '18 15:08 batradhruv

Between PR #5010 and other changes, I believe we no longer use NULL anywhere.

jorgbrown avatar Sep 01 '22 18:09 jorgbrown