[compute] Explicitly initialize dims_ in constructors to avoid uninitialized warnings#15155
Conversation
…ialized warnings This commit explicitly initialize dims_ in Shape constructors to avoid uninitialized warnings. - Set dims_ using std::array or std::vector in the (int, int32_t), (int, const int32_t*), and initializer-list constructors to ensure proper initialization before calling Resize(). - Added a check in Resize() using dims_.valueless_by_exception() to handle any uninitialized state. ONE-DCO-1.0-Signed-off-by: ragmani <ragmani0216@gmail.com>
|
To fix the build error(#15030 (comment)), This PR addresses a problem where the |
|
I was reading the code before merging. Personally I don't like to merge this.
As I wrote a few hours ago in #15157, I am investigating the reason, rather than rewriting and modifying the existing code to c++17. I expect the required change would be just a few lines or a few bytes. |
|
My priority is to ensure that the build doesn’t break, so for now, I'll implement fixes to avoid any build errors. Since I am only modifying the |
This commit explicitly initialize dims_ in Shape constructors to avoid uninitialized warnings.
ONE-DCO-1.0-Signed-off-by: ragmani ragmani0216@gmail.com