URL:
<https://savannah.gnu.org/bugs/?59583>
Summary: [PATCH]
Project: GNU troff
Submitted by: bjarniig
Submitted on: Tue 01 Dec 2020 01:28:14 AM UTC
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Details:
Subject: addftinfo.cpp: fix different declarations of "i" and "len"
A warning from the compiler:
CXX src/utils/addftinfo/addftinfo.o
../src/utils/addftinfo/addftinfo.cpp: In function 'void usage(FILE*)':
../src/utils/addftinfo/addftinfo.cpp:139:21: warning: comparison of integer
expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned
int'} [-Wsign-compare]
139 | for (int i = 0; i < len; i++)
| ~~^~~~~
I use the following patch:
--- /tmp/addftinfo.cpp 2020-12-01 01:08:50.000000000 +0000
+++ addftinfo.cpp 2020-12-01 01:09:26.000000000 +0000
@@ -136,7 +136,7 @@ static void usage(FILE *stream)
{
fprintf(stream, "usage: %s", program_name);
size_t len = sizeof(param_table)/sizeof(param_table[0]);
- for (int i = 0; i < len; i++)
+ for (size_t i = 0; i < len; i++)
fprintf(stream, " [-%s N]", param_table[i].name);
fprintf(stream, " RESOLUTION UNIT-WIDTH FONT\n");
fprintf(stream, "usage: %s -v\n", program_name);
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?59583>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/