Project

General

Profile

Bug #13427

Updated by Toomas Soome over 1 year ago

Build error with gcc 10: 
 <pre> 
     ../../common/io/ppm/ppm_subr.c: In function 'ppm_stoi': 
     ../../common/io/ppm/ppm_subr.c:998:16: error: overflow in conversion from 'uint_t' {aka 'unsigned int'} to 'int' changes value from '*val = 4294967295' to '-1' [-Werror=overflow] 
       998 |     return (*val = (uint_t)-1); 
           |            ~~~~~~^~~~~~~~~~~~~ 
     ../../common/io/ppm/ppm_subr.c: In function 'ppm_convert': 
     ../../common/io/ppm/ppm_subr.c:1070:16: error: overflow in conversion from 'uint_t' {aka 'unsigned int'} to 'int' changes value from '*val = 4294967295' to '-1' [-Werror=overflow] 
      1070 |     return (*val = (uint_t)-1); 
           |            ~~~~~~^~~~~~~~~~~~~ 
     ../../common/io/ppm/ppm_subr.c:1081:15: error: overflow in conversion from 'uint_t' {aka 'unsigned int'} to 'int' changes value from '*val = 4294967295' to '-1' [-Werror=overflow] 
      1081 |    return (*val = (uint_t)-1); 
           |           ~~~~~~^~~~~~~~~~~~~ 
     cc1: all warnings being treated as errors 
 </pre> 

 Signed versus unsigned values. Instead of -1, use UINT_MAX. 

 Testing done: build/install/boot

Back