GNU bug report logs - #61377
Too many [-Wsign-compare] warnings

Previous Next

Package: diffutils;

Reported by: Bjarni Ingi Gislason <bjarniig <at> simnet.is>

Date: Thu, 9 Feb 2023 03:39:01 UTC

Severity: normal

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bjarni Ingi Gislason <bjarniig <at> simnet.is>
To: bug-diffutils <at> gnu.org
Subject: Too many [-Wsign-compare] warnings
Date: Thu, 9 Feb 2023 00:10:59 +0000
  Compiling diffutils from git shows for example

In file included from ../../src/cmp.c:19:
../../src/cmp.c: In function 'cmp':
../../src/system.h:108:24: warning: comparison of integer expressions of different signedness: 'off_t' {aka 'long int'} and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
  108 | #define MIN(a, b) ((a) <= (b) ? (a) : (b))
      |                        ^~
../../src/cmp.c:419:38: note: in expansion of macro 'MIN'
  419 |               size_t bytes_to_read = MIN (ig, buf_size);
      |                                      ^~~
../../src/system.h:108:33: warning: operand of '?:' changes signedness from 'off_t' {aka 'long int'} to 'size_t' {aka 'long unsigned int'} due to unsignedness of other operand [-Wsign-compare]
  108 | #define MIN(a, b) ((a) <= (b) ? (a) : (b))
      |                                 ^~~
../../src/cmp.c:419:38: note: in expansion of macro 'MIN'
  419 |               size_t bytes_to_read = MIN (ig, buf_size);
      |                                      ^~~
../../src/cmp.c:439:25: warning: comparison of integer expressions of different signedness: 'intmax_t' {aka 'long int'} and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
  439 |           if (remaining < bytes_to_read)
      |                         ^

  
  Total number is 26.




This bug report was last modified 2 years and 127 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.