Ticket #3435 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

[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

mc-cleanup-clang-warnings-01.patch (574 bytes) - added by and 7 years ago.
mc-cleanup-clang-warnings-03.patch (788 bytes) - added by and 7 years ago.
mc-cleanup-clang-warnings-04.patch (752 bytes) - added by and 7 years ago.
mc-cleanup-clang-warnings-05.patch (1.2 KB) - added by and 7 years ago.
mc-cleanup-clang-warnings-06.patch (1.8 KB) - added by and 7 years ago.
mc-cleanup-clang-warnings-07.patch (1.5 KB) - added by and 7 years ago.
mc-cleanup-clang-warnings-02.patch (2.1 KB) - added by and 7 years ago.
v2
mc_fcntl.h.diff (10.0 KB) - added by andrew_b 7 years ago.
Include <fcntl.h> via "lib/global.h".

Change History

Changed 7 years ago by and

Changed 7 years ago by and

Changed 7 years ago by and

Changed 7 years ago by and

Changed 7 years ago by and

Changed 7 years ago by and

comment:1 in reply to: ↑ description Changed 7 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 7 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

Changed 7 years ago by and

v2

comment:3 in reply to: ↑ 2 Changed 7 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 7 years ago by andrew_b

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

comment:4 Changed 7 years ago by andrew_b

  • Blocked By 3420 added

comment:5 Changed 7 years ago by andrew_b

  • Blocked By 3420 removed

comment:6 Changed 7 years ago by andrew_b

  • Status changed from new to closed
  • Votes for changeset set to committed-master
  • Resolution set to fixed
  • Milestone changed from Future Releases to 4.8.15
Note: See TracTickets for help on using tickets.