otherwise gcc10 complains about out-of-boundry access:
llog_swab.c: In function lustre_swab_update_ops:
llog_swab.c:137:46: error: array subscript 65534 is outside the bounds
of an interior zero-length array__u16[0] {aka short unsigned int[]}
[-Werror=zero-length-bounds]
137 | __swab16s(&uops->uops_op[i].uop_params_off[j]);
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I27981cbc79991cbd7a79cb90aec97bd1dc8b2f1b
Reviewed-on: https://review.whamcloud.com/40486
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
struct lu_fid uop_fid;
__u16 uop_type;
__u16 uop_param_count;
struct lu_fid uop_fid;
__u16 uop_type;
__u16 uop_param_count;
- __u16 uop_params_off[0];
+ __u16 uop_params_off[];
} __attribute__((packed));
struct update_ops {
} __attribute__((packed));
struct update_ops {
(long long)(int)sizeof(((struct update_op *)0)->uop_param_count));
LASSERTF((int)offsetof(struct update_op, uop_params_off) == 20, "found %lld\n",
(long long)(int)offsetof(struct update_op, uop_params_off));
(long long)(int)sizeof(((struct update_op *)0)->uop_param_count));
LASSERTF((int)offsetof(struct update_op, uop_params_off) == 20, "found %lld\n",
(long long)(int)offsetof(struct update_op, uop_params_off));
- LASSERTF((int)sizeof(((struct update_op *)0)->uop_params_off) == 0, "found %lld\n",
- (long long)(int)sizeof(((struct update_op *)0)->uop_params_off));
/* Checks for struct update_ops */
LASSERTF((int)sizeof(struct update_ops) == 0, "found %lld\n",
/* Checks for struct update_ops */
LASSERTF((int)sizeof(struct update_ops) == 0, "found %lld\n",
(long long)(int)sizeof(((struct update_op *)0)->uop_param_count));
LASSERTF((int)offsetof(struct update_op, uop_params_off) == 20, "found %lld\n",
(long long)(int)offsetof(struct update_op, uop_params_off));
(long long)(int)sizeof(((struct update_op *)0)->uop_param_count));
LASSERTF((int)offsetof(struct update_op, uop_params_off) == 20, "found %lld\n",
(long long)(int)offsetof(struct update_op, uop_params_off));
- LASSERTF((int)sizeof(((struct update_op *)0)->uop_params_off) == 0, "found %lld\n",
- (long long)(int)sizeof(((struct update_op *)0)->uop_params_off));
/* Checks for struct update_ops */
LASSERTF((int)sizeof(struct update_ops) == 0, "found %lld\n",
/* Checks for struct update_ops */
LASSERTF((int)sizeof(struct update_ops) == 0, "found %lld\n",