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

[patch] clang compiler fixes/cleanups #3435

Closed
mc-butler opened this issue Apr 3, 2015 · 14 comments
Closed

[patch] clang compiler fixes/cleanups #3435

mc-butler opened this issue Apr 3, 2015 · 14 comments
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/3435
Reporter and

fix clang 3.6 compiler warnings

patch 01: -Wundef
patch 02: -Wunused-function
patch 03: -Wnon-literal-null-conversion
patch 04: -Wmissing-field-initializers
patch 05: -Wabsolute-value
patch 06: -Wtautological-pointer-compare
patch 07: -Wformat

Signed-off-by: Andreas Mohr <and@gmx.li>

Note

Original attachments:

@mc-butler
Copy link
Author

Changed by and on Apr 3, 2015 at 1:31 UTC

@mc-butler
Copy link
Author

Changed by and on Apr 3, 2015 at 1:31 UTC

@mc-butler
Copy link
Author

Changed by and on Apr 3, 2015 at 1:31 UTC

@mc-butler
Copy link
Author

Changed by and on Apr 3, 2015 at 1:31 UTC

@mc-butler
Copy link
Author

Changed by and on Apr 3, 2015 at 1:32 UTC

@mc-butler
Copy link
Author

Changed by and on Apr 3, 2015 at 1:32 UTC

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Apr 5, 2015 at 6:59 UTC

mc-cleanup-clang-warnings-01.patch​ looks not quite correct, because fcntl.h is included unconditionally everywhere it included in mc source tree. The another fix should be found.

mc-cleanup-clang-warnings-02.patch: if code is unused it should be removed not just commented out. Please don't use the //-style comments.

mc-cleanup-clang-warnings-06.patch and mc-cleanup-clang-warnings-07.patch will not be applied because we don't want support the ancient Samba code (see #1).

@mc-butler
Copy link
Author

Changed by and on Apr 5, 2015 at 11:53 UTC (comment 2)

mc-cleanup-clang-warnings-01.patch
lib/global.h use defines depends on fcntl.h (if file exists)
lib/global.h will only initial once (MC_GLOBAL_H)
when global.h called first time on .c file _without_ previous pull of fcntl.h definitions
it is semi unpredictable which .c file (which called first time global.h) have a pulled fcntl.h definition.

currently lib/event/event.c is called first (compile session) and without proper fcntl.h definition.
so for me fcntl.h belongs inside of global.h

mc-cleanup-clang-warnings-02.patch
You are right, I will provide a new patch

mc-cleanup-clang-warnings-06.patch
mc-cleanup-clang-warnings-07.patch
Good to know, I will skip/delete theses patches

@mc-butler
Copy link
Author

Changed by and on Apr 5, 2015 at 12:03 UTC

v2

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Apr 5, 2015 at 13:10 UTC (comment 2.3)

Replying to and:

mc-cleanup-clang-warnings-01.patch
lib/global.h use defines depends on fcntl.h (if file exists)
lib/global.h will only initial once (MC_GLOBAL_H)
when global.h called first time on .c file _without_ previous pull of fcntl.h definitions
it is semi unpredictable which .c file (which called first time global.h) have a pulled fcntl.h definition.

currently lib/event/event.c is called first (compile session) and without proper fcntl.h definition.
so for me fcntl.h belongs inside of global.h

Ok. Probably, include fcntl.h in global.h and remove all other includes of fcntl.h?

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Apr 5, 2015 at 13:18 UTC

Include <fcntl.h> via "lib/global.h".

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Apr 11, 2015 at 10:10 UTC

  • Blocked by set to #3420

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on May 3, 2015 at 16:52 UTC

  • Blocked by #3420 deleted

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on May 3, 2015 at 17:03 UTC (comment 6)

  • Resolution set to fixed
  • Status changed from new to closed
  • Votes set to committed-master
  • Milestone changed from Future Releases to 4.8.15

Thanks!
Applied as [b698b7e], [bd051e4], [e9e6868], [d74be13], [0364995], [c9b0731]

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: low Minor problem or easily worked around
Development

No branches or pull requests

1 participant