]> git.ipfire.org Git - thirdparty/grub.git/commit
asn1_test: Enable the testcase only when GRUB_LONG_MAX is larger than GRUB_INT_MAX
authorGary Lin <glin@suse.com>
Fri, 15 Nov 2024 07:34:43 +0000 (15:34 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 28 Nov 2024 20:50:54 +0000 (21:50 +0100)
commit8a0fedef21aa882cb70f3eb9ae143589701cbc6d
tree38c26c2bfa5e6e7286dd4946105da85b8a57196f
parent66cf4cb1448052cc5b04757821071917c82340ad
asn1_test: Enable the testcase only when GRUB_LONG_MAX is larger than GRUB_INT_MAX

There is a testcase to test the values larger than "int" but smaller
than "long". However, for some architectures, "long" and "int" are the
same and the compiler may issue a warning like this:

grub-core/tests/asn1/tests/Test_overflow.c:48:50: error: left shift of negative value [-Werror=shift-negative-value]
       unsigned long num = ((long) GRUB_UINT_MAX) << 2;
                                                  ^~

To avoid unnecessary error the testcase is enabled only when
GRUB_LONG_MAX is larger than GRUB_INT_MAX.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Stefan Berger <stefanb@linux.ibm.com>
grub-core/lib/libtasn1-patches/0013-asn1_test-enable-the-testcase-only-when-GRUB_LONG_MA.patch [new file with mode: 0644]