The -vcompound flag is used to output the size & aligments of compound types. Its correctness is thus dependent of the alignment of the types used, like 'uint64_t' which alignment is expected to be 8. This is a problem because this type is only so aligned on 64 bit archs and not on 32 ones, like i386 or arm. Fix this by explicitly ignoring the test if the alignment is not met. This solution avoids to make assumptions on the alignment of archs by directly testing the root condition. CC: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- validation/compound-sizes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/validation/compound-sizes.c b/validation/compound-sizes.c index 3d36f3eda..d8ccf6052 100644 --- a/validation/compound-sizes.c +++ b/validation/compound-sizes.c @@ -76,6 +76,7 @@ int main(void) /* * check-name: compound-sizes * check-command: sparse -vcompound $file + * check-assert: _Alignof(long long) == 8 * * check-error-start compound-sizes.c:39:17: union un static [toplevel] un: compound size 192, alignment 8 -- 2.17.0 -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html