Ticket #3435 (closed defect: fixed)
[patch] clang compiler fixes/cleanups
Reported by: | and | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 4.8.15 |
Component: | mc-core | Version: | master |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | no branch | Votes for changeset: | committed-master |
Description
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@…>
Attachments
Change History
comment:1 in reply to: ↑ description Changed 10 years ago by andrew_b
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).
comment:2 follow-up: ↓ 3 Changed 10 years ago by 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
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
comment:3 in reply to: ↑ 2 Changed 10 years ago by andrew_b
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?
Changed 10 years ago by andrew_b
- Attachment mc_fcntl.h.diff added
Include <fcntl.h> via "lib/global.h".