-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
comparison between pointer and zero #1760
Comments
The line should probably like this: |
Maybe, !=0 is OK too. |
No because failure to mmap results in -1. |
I added fix to my FreeBSD PR. Compiles on my test system with your fix. |
What about comparing it to NULL? |
When I try to compile Micro-manager, I trouble into ` ordered comparison between pointer and zero ('usb_dev_handle *' and 'int')`. Then I find same error in [here](ZoneMinder/zoneminder#1760). It work. Error: Making all in USBManager make[2]: Entering directory '/home/igem/Downloads/mm/micro-manager/DeviceAdapters/USBManager' /bin/sh ../libtool --tag=CXX --mode=compile clang++ -DPACKAGE_NAME=\"Micro-Manager\" -DPACKAGE_TARNAME=\"micro-manager\" -DPACKAGE_VERSION=\"1.4\" -DPACKAGE_STRING=\"Micro-Manager\ 1.4\" -DPACKAGE_BUGREPORT=\"info@micro-manager.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"micro-manager\" -DVERSION=\"1.4\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_BOOST=/\*\*/ -DHAVE_BOOST_THREAD=/\*\*/ -DHAVE_BOOST_ASIO=/\*\*/ -DHAVE_BOOST_SYSTEM=/\*\*/ -DHAVE_BOOST_CHRONO=/\*\*/ -DHAVE_BOOST_DATE_TIME=/\*\*/ -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DSTDC_HEADERS=1 -DHAVE_MEMSET=1 -I. -I/usr/include/libusb-1.0 -I/home/igem/Downloads/mm/micro-manager/DeviceAdapters/../MMDevice -pthread -I/usr/include -g -O2 -MT USBManager.lo -MD -MP -MF .deps/USBManager.Tpo -c -o USBManager.lo USBManager.cpp libtool: compile: clang++ -DPACKAGE_NAME=\"Micro-Manager\" -DPACKAGE_TARNAME=\"micro-manager\" -DPACKAGE_VERSION=\"1.4\" "-DPACKAGE_STRING=\"Micro-Manager 1.4\"" -DPACKAGE_BUGREPORT=\"info@micro-manager.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"micro-manager\" -DVERSION=\"1.4\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" "-DHAVE_BOOST=/**/" "-DHAVE_BOOST_THREAD=/**/" "-DHAVE_BOOST_ASIO=/**/" "-DHAVE_BOOST_SYSTEM=/**/" "-DHAVE_BOOST_CHRONO=/**/" "-DHAVE_BOOST_DATE_TIME=/**/" -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DSTDC_HEADERS=1 -DHAVE_MEMSET=1 -I. -I/usr/include/libusb-1.0 -I/home/igem/Downloads/mm/micro-manager/DeviceAdapters/../MMDevice -pthread -I/usr/include -g -O2 -MT USBManager.lo -MD -MP -MF .deps/USBManager.Tpo -c USBManager.cpp -fPIC -DPIC -o .libs/USBManager.o USBManager.cpp:284:34: error: ordered comparison between pointer and zero ('usb_dev_handle *' and 'int') if (deviceHandle_ <= 0) ~~~~~~~~~~~~~ ^ ~ 1 error generated. make[2]: *** [Makefile:524: USBManager.lo] Error 1 make[2]: Leaving directory '/home/igem/Downloads/mm/micro-manager/DeviceAdapters/USBManager' make[1]: *** [Makefile:615: all-recursive] Error 1 make[1]: Leaving directory '/home/igem/Downloads/mm/micro-manager/DeviceAdapters' make: *** [Makefile:518: all-recursive] Error 1
for the record, |
It seems like we should follow posix.. defined constants are both readable... and defined.. hence... good.. Mmkay? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
on: I had following error: jni/./gifvideo.cpp:151:28: error: ordered comparison between pointer and zero ('AVStream *' and 'int') Thanks @connortechnology, your solution worked for me too. Just commented here for everybody facing this issue later! |
ZoneMinder can't be compiled with CLANG 4.0 It bumped severity of such comparison to error.
src/zm_monitor.cpp contains comparison between (unsigned char*) mem_ptr and 0 in several places.
The text was updated successfully, but these errors were encountered: