Skip to content
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

Fix comparison between pointer and zero character constant. #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mjtrangoni
Copy link

Hi @cavaliercoder @jangaraj,

This fix #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]

@jangaraj
Copy link
Collaborator

jangaraj commented Apr 3, 2020

Hi Mario, did you test discovery with this new fix?

@mjtrangoni
Copy link
Author

Hi @jangaraj,

No, I still have to do that. Will let you know as soon as I have it running

@mjtrangoni mjtrangoni force-pushed the fix-gcc-warn branch 2 times, most recently from 46e2169 to b7b2aaf Compare April 3, 2020 09:02
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]>
@mjtrangoni
Copy link
Author

mjtrangoni commented Apr 3, 2020

Hi @jangaraj,
The output of /usr/sbin/zabbix_agentd -t systemd.unit.discovery["socket"] is the same after the patch.

@mjtrangoni
Copy link
Author

ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gcc9 complaining about comparison between pointer and zero character constant
3 participants