-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Fix compilation warnings in Lua and jemalloc dependencies #7785
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
Conversation
The argument `u` in the command `ar rcu` is ignore. Enable `LUA_USE_POSIX` to force the use of `mkstemp()` instead of `tmpname()`
Remove unused variable `c` in `f_parser()`
Removed misleadingly indented space in `luaL_loadfile()`
Removed misleadingly indented spaces within `addfield()`
|
@yoonghm can you please tell me which OS / compiler are you using? |
|
Hi, the warning will not show up unless you do a |
|
@yoonghm yeah, i know that.. i'm getting most of these warnings too, but not the one about |
|
By default, Lua uses Lines 36 to 40 in b96c359
and also Lines 636 to 660 in b96c359
So, I changed LUA_CFLAGS+= -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_POSIX $(CFLAGS)The warning was from Ubuntu 2020.04 |
|
but it also affects other things: i want to know the full list of implications of this change. btw, you still didn't tell me which OS / toolchain you're using.. i don't get this warning on my Ubuntu. |
|
I have actually I am using GCC on ubuntu running on x86. cc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSEThe problem was actually mentioned a few times. See
Let me check if the define would cause any issue. |
|
My investigation is that POSIX is meant for UNIX-Like operation system. If Developers are recommended to use WSL when running Redis within Windows 10. |
|
@yoonghm first there's also My two concerns are:
Can you please also explain the change to made to the ARFLAGS? # lua's Makefile defines AR="ar rcu", which is unusual, and makes it more
# challenging to cross-compile lua (and redis). These defines make it easier
# to fit redis into cross-compilation environments, which typically set AR. |
|
btw, I see the lua makefile has many build targets, maybe we should somehow use these? Line 84 in b96c359
|
|
Unix-like operating systems (Unix, Linux, MacOS) use I guess the original author of About the warning, I have no other operating systems with suitable compilers to test the build. Perhaps the
|
|
@yoonghm i know what i understand that currently it is ignored anyway, so dropping it won't actually change a thing, and even if it does, it just makes the archiving will take a bit longer, i doubt it's even measurable. regarding in this case, i think that it doesn't worth the effort, all we need is to hide a warning of a bunch of dead code (Lua doesn't create files in Redis anyway), so i think we just want to explicitly set While working on your branch i did notice a few other warnings, with your permission, i'll push a few commits into this PR. |
lower potential for side effects (all we want is solve a warning in dead code)
|
looks like i'm unable to push commits directly to your branch, and github doesn't let me edit files which you didn't already modify, can you add this change (related to your other change): --- a/deps/jemalloc/configure.ac
+++ b/deps/jemalloc/configure.ac
@@ -512,7 +512,7 @@ CTARGET='-o $@'
LDTARGET='-o $@'
TEST_LD_MODE=
EXTRA_LDFLAGS=
-ARFLAGS='crus'
+ARFLAGS='crs'
AROUT=' $@'
CC_MM=1
i'll push other unrelated changes in a different PR |
- The argument `u` in for `ar` is ignored (and generates warnings since `D` became the default. All it does is avoid updating unchanged objects (shouldn't have any impact on our build) - Enable `LUA_USE_MKSTEMP` to force the use of `mkstemp()` instead of `tmpname()` (which is dead code in redis anyway). - Remove unused variable `c` in `f_parser()` - Removed misleadingly indented space in `luaL_loadfile()` and ``addfield()` Co-authored-by: Oran Agra <oran@redislabs.com>
- The argument `u` in for `ar` is ignored (and generates warnings since `D` became the default. All it does is avoid updating unchanged objects (shouldn't have any impact on our build) - Enable `LUA_USE_MKSTEMP` to force the use of `mkstemp()` instead of `tmpname()` (which is dead code in redis anyway). - Remove unused variable `c` in `f_parser()` - Removed misleadingly indented space in `luaL_loadfile()` and ``addfield()` Co-authored-by: Oran Agra <oran@redislabs.com>
Upgraded to jemalloc 5.2.1 from 5.1.0. Cherry picked all relevant fixes (by diffing our 5.1.0 to upstream 5.10 and finding relevant commits). Details of what was done: [cherry-picked] fd7d51c 2021-05-03 Resolve nonsense static analysis warnings (Oran Agra) [cherry-picked] 448c435 2020-09-29 Fix compilation warnings in Lua and jemalloc dependencies (#7785) (YoongHM) [skipped - already in upstream] 9216b96 2020-09-21 Fix compilation warning in jemalloc's malloc_vsnprintf (#7789) (YoongHM) [cherry-picked] 88d71f4 2020-05-20 fix a rare active defrag edge case bug leading to stagnation (Oran Agra) [skipped - already in upstream] 2fec7d9 2019-05-30 Jemalloc: Avoid blocking on background thread lock for stats. [cherry-picked] 920158e 2018-07-11 Active defrag fixes for 32bit builds (again) (Oran Agra) [cherry-picked] e8099ca 2018-06-26 add defrag hint support into jemalloc 5 (Oran Agra) [re-done] 4e729fc 2018-05-24 Generate configure for Jemalloc. (antirez) Additionally had to do this: 7727cc2 2021-10-10 Fix defrag to support sharded bins in arena (added in v5.2.1) (Yoav Steinberg) When reviewing please look at all except the first commit which is just replacing 5.1.0 with 5.2.1 sources. Also I think we should merge this without squashing to preserve the changes we did to to jemalloc.
Fix warnings mentioned in issue #7784.
The pull request is for lua module.