KeDeng has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/23062 )

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


Patch Set 2:

(7 comments)

Thanks for the review and comments. I've updated the patch and revised the 
commit message to reflect that the warnings are false positives. The changes 
preserve the original behavior while ensuring clean builds with GCC on 
ARM/Rocky Linux.

http://gerrit.cloudera.org:8080/#/c/23062/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/23062/1//COMMIT_MSG@10
PS1, Line 10: locations where
            : variables are passed to constructors without explicit
            : initialization, even though the memory is not accessed prior
> Thank you for the patch!
Done


http://gerrit.cloudera.org:8080/#/c/23062/1//COMMIT_MSG@19
PS1, Line 19:
> This is simply not true: there cannot be any UB in the test logic due to th
Done


http://gerrit.cloudera.org:8080/#/c/23062/1//COMMIT_MSG@24
PS1, Line 24: ath-sensitive analysis.
> In fact, before each use 'key_buf' is being assigned withing the 'for ()' c
Done


http://gerrit.cloudera.org:8080/#/c/23062/1//COMMIT_MSG@27
PS1, Line 27: `buf[3]` array is used to simulate a corrupted trail
> Seems to be a typo: if it were initialized, it wouldn't trigger the bogus w
Done


http://gerrit.cloudera.org:8080/#/c/23062/1//COMMIT_MSG@31
PS1, Line 31: 
> nit: I wouldn't say those are stricter compilers, they are rather inferior
Done


http://gerrit.cloudera.org:8080/#/c/23062/1/src/kudu/cfile/bloomfile-test-base.cc
File src/kudu/cfile/bloomfile-test-base.cc:

http://gerrit.cloudera.org:8080/#/c/23062/1/src/kudu/cfile/bloomfile-test-base.cc@61
PS1, Line 61:   for (uint64_t i = 0; i < FLAGS_n_keys; i++) {
            :     // Shift the key left a bit so that while querying, we can
            :     // get a good mix of hits and misses while still staying 
within
            :     // the real key range.
            :     uint64_t key_buf = BigEndian::FromHost64(i << kKeyShift);
            :
            :     Slice key_slice(reinterpret_cast<const uint8_t*>(&key_buf),
            :                     sizeof(key_buf));
            :     ASSERT_OK_FAST(bfw->AppendKeys(&key_slice, 1));
            :   }
            : }
> Instead of useless initialization just to silence warnings, I'd think of cl
Done


http://gerrit.cloudera.org:8080/#/c/23062/1/src/kudu/cfile/index-test.cc
File src/kudu/cfile/index-test.cc:

http://gerrit.cloudera.org:8080/#/c/23062/1/src/kudu/cfile/index-test.cc@428
PS1, Line 428:
> I'd rather have some garbage data here instead of buffer filled with 0.  Th
Thanks for the feedback. I’ve updated the code to initialize buf with 
pseudo-random but deterministic bytes instead of zeroing it out. This ensures 
we preserve the corruption-testing semantics while avoiding the compiler 
warning without suppressing it.



--
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: comment
Gerrit-Change-Id: Ic6442c5b0d8087f6360916070299278fcc41d39b
Gerrit-Change-Number: 23062
Gerrit-PatchSet: 2
Gerrit-Owner: KeDeng <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: KeDeng <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 26 Jun 2025 08:04:39 +0000
Gerrit-HasComments: Yes

Reply via email to