Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.1.2: gcc 10 warnings #4586

Closed
kloczek opened this issue Apr 25, 2020 · 1 comment · Fixed by #5127
Closed

7.1.2: gcc 10 warnings #4586

kloczek opened this issue Apr 25, 2020 · 1 comment · Fixed by #5127
Labels

Comments

@kloczek
Copy link

kloczek commented Apr 25, 2020

src/_imaging.c: In function ‘_set_blocks_max’:
src/_imaging.c:3743:26: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
 3743 |     else if ( blocks_max > SIZE_MAX/sizeof(ImagingDefaultArena.blocks_pool[0])) {
      |                          ^
src/path.c: In function ‘alloc_array’:
src/path.c:59:15: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘long unsigned int’ [-Wsign-compare]
   59 |     if (count > (SIZE_MAX / (2 * sizeof(double))) - 1 ) {
      |               ^
src/libImaging/Resample.c: In function ‘precompute_coeffs’:
src/libImaging/Resample.c:200:17: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
  200 |     if (outSize > INT_MAX / (ksize * sizeof(double))) {
      |                 ^
src/libImaging/Draw.c: In function ‘allocate’:
src/libImaging/Draw.c:1065:31: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
 1065 |             if (outline->size > INT_MAX / sizeof(Edge)) {
      |                               ^
src/libImaging/GetBBox.c: In function ‘ImagingGetExtrema’:
src/libImaging/GetBBox.c:189:25: warning: pointer targets in assignment from ‘char *’ to ‘unsigned char *’ differ in signedness [-Wpointer-sign]
  189 |                   pixel = im->image[y] + x * sizeof(v);
      |                         ^
src/libImaging/JpegEncode.c: In function ‘ImagingJpegEncode’:
src/libImaging/JpegEncode.c:248:37: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
  248 |         if (context->rawExifLen + 5 >  context->destination.pub.free_in_buffer){
      |                                     ^
src/libImaging/RankFilter.c: In function ‘ImagingRankFilter’:
src/libImaging/RankFilter.c:65:14: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
   65 |         size > INT_MAX / (size * sizeof(FLOAT32))) {
      |              ^
src/libImaging/TiffDecode.c: In function ‘ImagingLibTiffDecode’:
src/libImaging/TiffDecode.c:386:33: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
  386 |         for (y = state->yoff; y < state->ysize; y += tile_length) {
      |                                 ^
src/libImaging/TiffDecode.c:387:37: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
  387 |             for (x = state->xoff; x < state->xsize; x += tile_width) {
      |                                     ^
In file included from src/libImaging/TiffDecode.c:21:
src/libImaging/TiffDecode.h:23:23: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
   23 | #define min(x,y) (( x > y ) ? y : x )
      |                       ^
src/libImaging/TiffDecode.c:471:45: note: in expansion of macro ‘min’
  471 |             for (strip_row = 0; strip_row < min(rows_per_strip, state->ysize - state->y); strip_row++) {
      |                                             ^~~
src/libImaging/TiffDecode.c:471:65: warning: operand of ‘?:’ changes signedness from ‘int’ to ‘unsigned int’ due to unsignedness of other operand [-Wsign-compare]
  471 |             for (strip_row = 0; strip_row < min(rows_per_strip, state->ysize - state->y); strip_row++) {
      |                                                                 ^~~~~~~~~~~~~~~~~~~~~~~
src/libImaging/TiffDecode.h:23:31: note: in definition of macro ‘min’
   23 | #define min(x,y) (( x > y ) ? y : x )
      |                               ^
src/libImaging/Jpeg2KDecode.c: In function ‘j2k_decode_entry’:
src/libImaging/Jpeg2KDecode.c:714:29: warning: comparison of integer expressions of different signedness: ‘OPJ_INT32’ {aka ‘int’} and ‘OPJ_UINT32’ {aka ‘unsigned int’} [-Wsign-compare]
  714 |             || tile_info.x0 < image->x0
      |                             ^
src/libImaging/Jpeg2KDecode.c:715:29: warning: comparison of integer expressions of different signedness: ‘OPJ_INT32’ {aka ‘int’} and ‘OPJ_UINT32’ {aka ‘unsigned int’} [-Wsign-compare]
  715 |             || tile_info.y0 < image->y0
      |                             ^
src/libImaging/Jpeg2KDecode.c:716:41: warning: comparison of integer expressions of different signedness: ‘OPJ_UINT32’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
  716 |             || tile_info.x1 - image->x0 > im->xsize
      |                                         ^
src/libImaging/Jpeg2KDecode.c:717:41: warning: comparison of integer expressions of different signedness: ‘OPJ_UINT32’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
  717 |             || tile_info.y1 - image->y0 > im->ysize) {
      |                                         ^
src/libImaging/Jpeg2KEncode.c: In function ‘j2k_write’:
src/libImaging/Jpeg2KEncode.c:57:21: warning: operand of ‘?:’ changes signedness from ‘int’ to ‘long unsigned int’ due to unsignedness of other operand [-Wsign-compare]
   57 |     return result ? result : (OPJ_SIZE_T)-1;
      |                     ^~~~~~
src/libImaging/Jpeg2KEncode.c: In function ‘j2k_encode_entry’:
src/libImaging/Jpeg2KEncode.c:400:21: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘long unsigned int’ [-Wsign-compare]
  400 |             if (len > sizeof(params.tcp_rates) / sizeof(params.tcp_rates[0]))
      |                     ^
src/libImaging/QuantPngQuant.c: In function ‘quantize_pngquant’:
src/libImaging/QuantPngQuant.c:81:19: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
   81 |     for (y = 0; y < height; y++) {
      |                   ^
src/libImaging/QuantPngQuant.c:91:19: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
   91 |     for (i = 0; i < width * height; i++) {
      |                   ^
@hugovk hugovk added the Build label Apr 25, 2020
@radarhere
Copy link
Member

radarhere commented Apr 25, 2020

Hi. #4551 resolved warnings for

  • JpegEncode.c
  • Jpeg2KEncode.c
  • QuantPngQuant.c

#4752 resolved

  • path.c

#4756 resolved

  • TiffDecode.c

#5122 resolved

  • _imaging.c
  • Draw.c
  • Jpeg2KDecode.c
  • RankFilter.c
  • Resample.c

#5127 resolved

  • GetBBox.c
  • _imagingft.c, which I guess has appeared since this issue was created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants