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

To reply to this bug, email your comments to 61377 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-diffutils <at> gnu.org:
bug#61377; Package diffutils. (Thu, 09 Feb 2023 03:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bjarni Ingi Gislason <bjarniig <at> simnet.is>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Thu, 09 Feb 2023 03:39:02 GMT) Full text and rfc822 format available.

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 1 year and 292 days ago.

Previous Next


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