KeDeng has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/23062


Change subject: Fix -Wmaybe-uninitialized warnings on ARM/Rocky Linux builds
......................................................................

Fix -Wmaybe-uninitialized warnings on ARM/Rocky Linux builds

Several `-Wmaybe-uninitialized` warnings were triggered during compilation
on ARM-based systems running Rocky Linux. These warnings were due to
variables being used to construct objects without explicit initialization,
which may lead to undefined behavior if the memory contents are later accessed.

1. `log_util.cc`: The `scratch` buffer used for reading the log segment
   header and footer was not initialized before constructing a `Slice`.
   Fixed by zero-initializing the buffer.

2. `index-test.cc`: The `buf` array was used to construct a `Slice`
   without being initialized, potentially leading to UB in test logic.
   Fixed via zero-initialization.

3. `bloomfile-test-base.cc`: `key_buf` (a `uint64_t`) was used without
   initialization when constructing a `Slice`. This was resolved by setting
   `key_buf = 0` before use.

4. `env_posix.cc`: The `magic` buffer used in the encryption header logic
   was uninitialized before being passed into a `Slice`. This has been
   fixed by zero-initializing the `magic` buffer.

These fixes ensure safer initialization semantics and help maintain
clean builds on stricter compilers, particularly in Rocky 9 + ARM
environments.

Change-Id: Ic6442c5b0d8087f6360916070299278fcc41d39b
---
M src/kudu/cfile/bloomfile-test-base.cc
M src/kudu/cfile/index-test.cc
M src/kudu/consensus/log_util.cc
M src/kudu/util/env_posix.cc
4 files changed, 6 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/62/23062/1
--
To view, visit http://gerrit.cloudera.org:8080/23062
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic6442c5b0d8087f6360916070299278fcc41d39b
Gerrit-Change-Number: 23062
Gerrit-PatchSet: 1
Gerrit-Owner: KeDeng <[email protected]>

Reply via email to