-
Notifications
You must be signed in to change notification settings - Fork 18
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
gcc9 complaining about comparison between pointer and zero character constant #44
Comments
...and rightly so!
It should have been @mjtrangoni, would you like to create a pull request? I'm sure @cavaliercoder or @jangaraj will be happy to merge it. |
@i-ky thanks for the explanation. I'll submit a PR tomorrow. |
Fix zabbix-tools#44 See, libzbxsystemd.c: In function ‘SYSTEMD_UNIT_DISCOVERY’: libzbxsystemd.c:214:35: warning: comparison between pointer and zero character constant [-Wpointer-compare] 214 | if(NULL != filter || '\0' != filter) | ^~ libzbxsystemd.c:214:38: note: did you mean to dereference the pointer? 214 | if(NULL != filter || '\0' != filter) | Signed-off-by: Mario Trangoni <[email protected]>
Fix zabbix-tools#44 See, libzbxsystemd.c: In function ‘SYSTEMD_UNIT_DISCOVERY’: libzbxsystemd.c:214:35: warning: comparison between pointer and zero character constant [-Wpointer-compare] 214 | if(NULL != filter || '\0' != filter) | ^~ libzbxsystemd.c:214:38: note: did you mean to dereference the pointer? 214 | if(NULL != filter || '\0' != filter) | Signed-off-by: Mario Trangoni <[email protected]>
Fix zabbix-tools#44 See, libzbxsystemd.c: In function ‘SYSTEMD_UNIT_DISCOVERY’: libzbxsystemd.c:214:35: warning: comparison between pointer and zero character constant [-Wpointer-compare] 214 | if(NULL != filter || '\0' != filter) | ^~ libzbxsystemd.c:214:38: note: did you mean to dereference the pointer? 214 | if(NULL != filter || '\0' != filter) | Signed-off-by: Mario Trangoni <[email protected]>
Fix zabbix-tools#44 See, libzbxsystemd.c: In function ‘SYSTEMD_UNIT_DISCOVERY’: libzbxsystemd.c:214:35: warning: comparison between pointer and zero character constant [-Wpointer-compare] 214 | if(NULL != filter || '\0' != filter) | ^~ libzbxsystemd.c:214:38: note: did you mean to dereference the pointer? 214 | if(NULL != filter || '\0' != filter) | Signed-off-by: Mario Trangoni <[email protected]>
Hi @cavaliercoder,
gcc[1] reports this warning,
Why do you need to check that in parallel to the correspondent NULL?
[1] gcc (GCC) 9.3.1 20200317 (Red Hat 9.3.1-1)
The text was updated successfully, but these errors were encountered: