onnxruntime
8ebd0bf1 - Fix(build): Correct maybe-uninitialized and range-loop-construct warnings (#26201)

Commit
161 days ago
Fix(build): Correct maybe-uninitialized and range-loop-construct warnings (#26201) This pull request addresses two build warnings that were treated as errors: 1. **`maybe-uninitialized` warning in `nchwc_transformer.cc`**: A `maybe-uninitialized` warning was triggered when accessing `nchwc_inputs[0]` without checking if `nchwc_inputs` was empty. This could lead to a crash if a binary node had no inputs. The fix adds a check to ensure the vector is not empty before accessing the first element. 2. **`range-loop-construct` warnings in `transformer_memcpy.cc`**: The compiler warned about creating copies of objects in range-based for loops. This was resolved by using references (`const auto&`) instead of copies (`const auto`) for the loop variables, which is more efficient. This fix was provided by an AI bot.
Author
Changming Sun
Parents
Loading