Fix uninitialized var errors
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest8 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | ipc: Fix uninitialized var error by removing useless arglibs/ testcases/ | +2 | 0 replies | |
| 2/8 | ftest: Fix uninitialized var errortestcases/ testcases/ | +2 | 0 replies | |
| 3/8 | hotplug: Fix uninitialized vartestcases/ | +1 | 0 replies | |
| 4/8 | dio: Fix uninitialized var errortestcases/ testcases/ testcases/ | +4 | 0 replies | |
| 5/8 | ksmg01: Fix uninitialized var errortestcases/ | +1 | 0 replies | |
| 6/8 | shmat01: Fix uninitialized var errortestcases/ | +1 | 0 replies | |
| 7/8 | crash02: Save actual child PID instead of uninitialized variabletestcases/ | +3 | 0 replies | |
| 8/8 | locktests: Fix uninitialized var errortestcases/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [LTP] [PATCH 0/8] Fix uninitialized var errors
Hello,
It would be nice if we could set --Werror=uninitialized by default. Uninitialized variables can result in nasty compiler behaviour. You may expect it just to result in garbage data being used. The result being a crash. However as we compile with -O2 this is not the case. Often the compiler chooses values for the variable which will eliminate code. This often means the values are valid. The result being a program which appears to execute correctly on the surface. Meanwhile underneath it is doing very little.
In a lot of cases the compiler is simply confused and gives an error, but there is no undefined behaviour. This is often caused by tst_brk which is the source of much confusion. Most likely there should be two versions of tst_brk. One which never returns and is used by test authors and one which can return, but is usually only used in library functions which may be called from cleanup.
Richard Palethorpe (8):
ipc: Fix uninitialized var error by removing useless arg
ftest: Fix uninitialized var error
hotplug: Fix uninitialized var
dio: Fix uninitialized var error
ksmg01: Fix uninitialized var error
shmat01: Fix uninitialized var error
crash02: Save actual child PID instead of uninitialized variable
locktests: Fix uninitialized var error
libs/libltpipc/libipc.c | 4 +--- testcases/kernel/fs/ftest/ftest01.c | 3 +-- testcases/kernel/fs/ftest/ftest05.c | 3 +-- testcases/kernel/hotplug/memory_hotplug/commands.c | 7 +------ testcases/kernel/io/ltp-aiodio/dio_append.c | 2 +- testcases/kernel/io/ltp-aiodio/dio_sparse.c | 2 +- testcases/kernel/io/ltp-aiodio/dio_truncate.c | 4 ++-- testcases/kernel/logging/kmsg/kmsg01.c | 2 +- testcases/kernel/syscalls/ipc/semctl/semctl01.c | 4 +--- testcases/kernel/syscalls/ipc/shmat/shmat01.c | 2 +- testcases/misc/crash/crash02.c | 6 +++--- testcases/network/nfsv4/locks/locktests.c | 2 +- 12 files changed, 15 insertions(+), 26 deletions(-)
Signature · 1 line
2.31.1