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

comparison between pointer and zero character constant #3856

Closed
mc-butler opened this issue Sep 22, 2017 · 5 comments
Closed

comparison between pointer and zero character constant #3856

mc-butler opened this issue Sep 22, 2017 · 5 comments
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/3856
Reporter egmont (@egmontkob)

gcc-7.2 caught this:

  CC       boxes.lo
boxes.c: In function ‘jobs_fill_listbox’:
boxes.c:431:22: warning: comparison between pointer and zero character constant [-Wpointer-compare]
     if (state_str[0] == '\0')
                      ^~
boxes.c:431:9: note: did you mean to dereference the pointer?
     if (state_str[0] == '\0')
         ^

It's indeed right, the code is buggy. It should be state_str[0][0].

Note

Original attachments:

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Sep 22, 2017 at 16:06 UTC

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Sep 22, 2017 at 16:07 UTC (comment 1)

... or maybe like this (see attached patch)?

(I haven't tried runtime, just compiled it :))

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 22, 2017 at 16:54 UTC (comment 2)

  • Blocked by set to #3780

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 22, 2017 at 16:57 UTC (comment 3)

This is already fixed in 3780_cleanup: [b2bbd326e0aa77df8aa48b4a1b4fd25bbbb7a40a].

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Sep 22, 2017 at 17:01 UTC (comment 4)

  • Resolution set to fixed
  • Status changed from new to closed

Oops, sorry then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress
Development

No branches or pull requests

1 participant