chrono icon indicating copy to clipboard operation
chrono copied to clipboard

-Wzero-as-null-pointer-constant leads to compiler error in g++

Open joernschellhaas opened this issue 6 years ago • 2 comments

As of boost 1.72, I'm getting "error: zero as null pointer constant" when using e.g. boost::chrono::milliseconds. This can IMO be fixed by using nullptr instead.

I've spotted the following places, but there might be more:

  • duration.hpp:458
  • duration.hpp:481
  • duration_put.hpp:216
  • time_point.hpp:185

joernschellhaas avatar Jan 15 '20 14:01 joernschellhaas

Boost is compatible with C++98.

A PR is more than welcome if you manage with this fact.

viboes avatar Jan 28 '20 21:01 viboes

Seems that NULL can be used to ensure compatibility. Not sure if I'll create a PR.

joernschellhaas avatar Jan 28 '20 21:01 joernschellhaas