Fix Gcc warnings#9756
Open
stsoe wants to merge 1 commit intoXilinx:masterfrom
Open
Conversation
Avoid GCC15 warnings and adjust improper code - Known GCC 15 false positive around std::any_cast<std::vector<char>> and vector copy/destruction at high optimization levels. - Don't catch by value (pyxrt) Adjust function in info_memory.cpp to be more pendatic in how it checks data received from query request. Adjust the size of ps_kernel_node to use true flexible array. Signed-off-by: Soren Soe <[email protected]>
|
|
||
| for (unsigned int i = 0; i < map->pkn_count; i++) | ||
| ps_kernels.emplace_back(map->pkn_data[i]); | ||
| auto needed = sizeof(ps_kernel_node) * map->pkn_count * sizeof(ps_kernel_data); |
Contributor
There was a problem hiding this comment.
warning: suspicious 'sizeof' by 'sizeof' multiplication [bugprone-sizeof-expression]
auto needed = sizeof(ps_kernel_node) * map->pkn_count * sizeof(ps_kernel_data);
^| @@ -34,7 +24,7 @@ struct ps_kernel_data { | |||
|
|
|||
| struct ps_kernel_node { | |||
| uint32_t pkn_count; | |||
Contributor
There was a problem hiding this comment.
warning: unknown type name 'uint32_t' [clang-diagnostic-error]
uint32_t pkn_count;
^| struct ps_kernel_node { | ||
| uint32_t pkn_count; | ||
| struct ps_kernel_data pkn_data[1]; | ||
| struct ps_kernel_data pkn_data[]; |
Contributor
There was a problem hiding this comment.
warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays]
struct ps_kernel_data pkn_data[];
^
maxzhen
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem solved by the commit
Avoid GCC15 warnings and adjust improper code
Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered
How problem was solved, alternative solutions (if any) and why they were rejected
Adjust function in info_memory.cpp to be more pendatic in how it
checks data received from query request. Adjust the size of
ps_kernel_node to use true flexible array.