Project

General

Profile

Bug #853412

astr_reserve() sign-compare compiler warning

Added by Marko Lindqvist 7 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Category:
General
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

With -Wsign-compare compiler warnings enabled:

../../../src/utility/astring.c: In function ‘astr_reserve’:
../../../src/utility/astring.c:177:22: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
177 | astr->n_alloc = (n > n1) ? n : n1; | ^
../../../src/utility/astring.c:177:34: error: operand of ?: changes signedness from ‘int’ to ‘size_t’ {aka ‘long unsigned int’} due to unsignedness of other operand [-Werror=sign-compare]
177 | astr->n_alloc = (n > n1) ? n : n1;

History

#1 Updated by Marko Lindqvist 7 months ago

#2 Updated by Marko Lindqvist 7 months ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF