diff options
author | Zhang Kunbo <zhangkunbo@huawei.com> | 2024-12-18 07:44:39 +0000 |
---|---|---|
committer | Andreas Larsson <andreas@gaisler.com> | 2025-01-17 16:33:27 +0100 |
commit | f4ab186830222a18e2c232b425f2945b408e2607 (patch) | |
tree | 33a05a12c06827f19e2a97b74717595bff71f5b1 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 929bd2a1772c91159b7a26fb559c8e4cde0d3dc3 (diff) |
sparc: replace zero-length array with flexible-array member
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1],
introduced in C99:
struct foo {
int stuff;
struct boo array[];
};
By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last, which is beneficial
to cultivate a high-quality code.[2]
This issue was found with the help of Coccinelle.
[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")
Signed-off-by: Zhang Kunbo <zhangkunbo@huawei.com>
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Link: https://lore.kernel.org/r/20241218074439.3271397-1-zhangkunbo@huawei.com
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions