[vim/vim] fix: clang-17 compilation warnings (PR #13166)

18 views
Skip to first unread message

Dominique Pellé

unread,
Sep 23, 2023, 2:46:05 PM9/23/23
to vim/vim, Subscribed

Change fixes this kind of compilation warnings with clang-17:

proto/if_python3.pro:13:20: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
   13 | int python3_version();
      |                    ^
      |                     void

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/13166

Commit Summary

  • a410778 fix: clang-17 compilation warnings

File Changes

(4 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13166@github.com>

Philip H.

unread,
Sep 23, 2023, 2:51:44 PM9/23/23
to vim/vim, Subscribed

Interesting how do you compile vim?
I have made a PR to get clang-17 on the CI but it runs fine on latest patch.:
#12745


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13166/c1732386590@github.com>

codecov[bot]

unread,
Sep 23, 2023, 2:56:29 PM9/23/23
to vim/vim, Subscribed

Codecov Report

Merging #13166 (a410778) into master (ceee7a8) will increase coverage by 0.60%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master   #13166      +/-   ##
==========================================
+ Coverage   82.13%   82.73%   +0.60%     
==========================================
  Files         160      150      -10     
  Lines      195308   182098   -13210     
  Branches    43823    40921    -2902     
==========================================
- Hits       160412   150665    -9747     
+ Misses      22058    18487    -3571     
- Partials    12838    12946     +108     
Flag Coverage Δ
huge-clang-Array 82.73% <100.00%> (-0.01%) ⬇️
linux 82.73% <100.00%> (-0.01%) ⬇️
mingw-x64-HUGE ?
mingw-x86-HUGE ?
windows ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/os_unix.c 66.97% <ø> (-0.05%) ⬇️
src/debugger.c 90.76% <100.00%> (+1.59%) ⬆️
src/if_python3.c 80.86% <100.00%> (+6.41%) ⬆️

... and 140 files with indirect coverage changes


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13166/c1732387443@github.com>

Dominique Pellé

unread,
Sep 24, 2023, 3:29:22 AM9/24/23
to vim/vim, Subscribed

@pheiduck asked:

Interesting how do you compile vim?
I have made a PR to get clang-17 on the CI but it runs fine on latest patch.:
#12745

To reproduce the warning with clang-17, I had uncommented out this line to enable -Wall -Wmissing-prototypes:

$ git diff
diff --git a/src/Makefile b/src/Makefile
index 4d0a5ebad..a5c0d9dea 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -602,7 +602,7 @@ CClink = $(CC)
 #CFLAGS = -g -O2 -fno-strength-reduce -Wall -Wmissing-prototypes
 #CFLAGS = -g -Wall -Wmissing-prototypes
 #CFLAGS = -O6 -fno-strength-reduce -Wall -Wshadow -Wmissing-prototypes
-#CFLAGS = -g -DDEBUG -Wall -Wshadow -Wmissing-prototypes
+CFLAGS = -g -DDEBUG -Wall -Wshadow -Wmissing-prototypes
 #CFLAGS = -g -O2 '-DSTARTUPTIME="vimstartup"' -fno-strength-reduce -Wall -Wmissing-prototypes

 # Use this with GCC to check for mistakes, unused arguments, etc.

I now see that the warning is not specific to clang-17 actually, it also happens with clang-14, clang-15, gcc-9, gcc-11 for example, so I'll reword the commit message.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13166/c1732509491@github.com>

Christian Brabandt

unread,
Sep 24, 2023, 10:17:12 AM9/24/23
to vim/vim, Subscribed

Closed #13166 via 4927bc7.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13166/issue_event/10455308040@github.com>

Yee Cheng Chin

unread,
Sep 24, 2023, 8:10:53 PM9/24/23
to vim/vim, Subscribed

I think if certain warnings are important, such as -Wmissing-prototypes and -Wstrict-prototypes, we should turn them on in ci/config.mk.sed or ci/config.mk.gcc.sed or ci/config.mk.clang.sed. This way it will actually checked in CI.

Otherwise it's just whack-a-mole every time. We should either decide if such warnings are important (in which case we check them in CI), or unimportant (in which case we don't bother fixing them).


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13166/c1732710232@github.com>

Yee Cheng Chin

unread,
Sep 26, 2023, 4:41:31 PM9/26/23
to vim/vim, Subscribed

Hmm, I tried adding this to CI and seems like GTK and Ruby headers don't really like them, so it would be a little annoying to just add them in unless we also add warning suppression when including those headers…


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13166/c1736265433@github.com>

Reply all
Reply to author
Forward
0 new messages