neufieldrobotics / spinnaker_sdk_camera_driver

Point Grey (FLIR) Spinnaker based camera driver (Blackfly S etc.)
MIT License
125 stars 90 forks source link

Warning of passing a NULL to non-pointer #78

Closed Benefe closed 4 years ago

Benefe commented 4 years ago

While building with catkin_make I get a Warning:

spinnaker_sdk_camera_driver/src/camera.cpp:5:13: warning: passing NULL to non-pointer argument 1 of ‘Spinnaker::CameraPtr::CameraPtr(long int)’ [-Wconversion-null] pCam_ = NULL; Does not effect usability but isn't clean code or functionality.

ghost commented 4 years ago

This warning started showing up when we moved to c++11. I couldn't figure out how to do this in a way to avoid the warning other than suppressing Warnings. If you can think of a better way, please advise.

Benefe commented 4 years ago

That's should be an easy fix, by using nullptr instead of NULL.

ghost commented 4 years ago

@Benefe I think I have tried this in the past and it does get rid of the compilation error. However, if I remember correctly, it throws a runtime error. Unfortunately I don't have a camera where I am quarantined to try this. If you have one, can you try and confirm.

Benefe commented 4 years ago

@shahvi I see. Once I get the driver to run (see Issue 80) I will try it. Luckily I took a camera with me before lockdown.