Actions
Bug #11587
closedloader.efi: comparison is always true due to limited range of data type
Start date:
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
Description
Build errors with warnings enabled:
../copy.c: In function 'efi_copyin': ../copy.c:209:14: error: comparison is always true due to limited range of data type [-Werror=type-limits] 209 | assert(dest < 0x100000000); | ^ ../../../../../include/assert.h:54:21: note: in definition of macro 'assert' 54 | #define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \ | ^ ../copy.c: In function 'efi_copyout': ../copy.c:217:13: error: comparison is always true due to limited range of data type [-Werror=type-limits] 217 | assert(src < 0x100000000); | ^ ../../../../../include/assert.h:54:21: note: in definition of macro 'assert' 54 | #define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \ | ^ cc1: all warnings being treated as errors
Replace 0x100000000 (which is UINT32_MAX + 1) by UINT32_MAX, this way we will satisfy both 64-and 32-bit build.
Updated by Electric Monk almost 3 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
git commit cf691b2b138fb3e0396a16406094b82ec555610e
commit cf691b2b138fb3e0396a16406094b82ec555610e Author: Toomas Soome <tsoome@me.com> Date: 2019-09-17T20:14:03.000Z 11587 loader.efi: comparison is always true due to limited range of data type Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Robert Mustacchi <rm@fingolfin.org> Approved by: Dan McDonald <danmcd@joyent.com>
Actions