Skip to content

Commit b16ad96

Browse files
committed
patch 8.2.0106: printf formats are not exactly right
Problem: Printf formats are not exactly right. Solution: Adjust signed/unsigned conversions. (Frazer Clews, closes #5456)
1 parent c838626 commit b16ad96

5 files changed

Lines changed: 21 additions & 19 deletions

File tree

runtime/tools/ccfilter.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ int main( int argc, char *argv[] )
184184
case COMPILER_GCC:
185185
Severity = 'e';
186186
#ifdef GOTO_FROM_WHERE_INCLUDED
187-
rv = sscanf( Line, "In file included from %[^:]:%u:",
187+
rv = sscanf( Line, "In file included from %[^:]:%lu:",
188188
FileName, &Row );
189189
if ( rv == 2 )
190190
{
@@ -193,55 +193,55 @@ int main( int argc, char *argv[] )
193193
else
194194
#endif
195195
{
196-
if ((rv = sscanf( Line, "%[^:]:%u: warning: %[^\n]",
196+
if ((rv = sscanf( Line, "%[^:]:%lu: warning: %[^\n]",
197197
FileName, &Row, Reason ))==3) {
198198
Severity = 'w';
199199
} else {
200-
rv = sscanf( Line, "%[^:]:%u: %[^\n]",
200+
rv = sscanf( Line, "%[^:]:%lu: %[^\n]",
201201
FileName, &Row, Reason );
202202
}
203203
ok = ( rv == 3 );
204204
}
205205
Col = (dec_col ? 1 : 0 );
206206
break;
207207
case COMPILER_AIX:
208-
rv = sscanf( Line, "\"%[^\"]\", line %u.%u: %*s (%c) %[^\n]",
208+
rv = sscanf( Line, "\"%[^\"]\", line %lu.%lu: %*s (%c) %[^\n]",
209209
FileName, &Row, &Col, &Severity, Reason );
210210
ok = ( rv == 5 );
211211
break;
212212
case COMPILER_HPUX:
213-
rv = sscanf( Line, "cc: \"%[^\"]\", line %u: %c%*[^:]: %[^\n]",
213+
rv = sscanf( Line, "cc: \"%[^\"]\", line %lu: %c%*[^:]: %[^\n]",
214214
FileName, &Row, &Severity, Reason );
215215
ok = ( rv == 4 );
216216
Col = (dec_col ? 1 : 0 );
217217
break;
218218
case COMPILER_SOLARIS:
219-
rv = sscanf( Line, "\"%[^\"]\", line %u: warning: %[^\n]",
219+
rv = sscanf( Line, "\"%[^\"]\", line %lu: warning: %[^\n]",
220220
FileName, &Row, Reason );
221221
Severity = 'w';
222222
ok = ( rv == 3 );
223223
if ( rv != 3 )
224224
{
225-
rv = sscanf( Line, "\"%[^\"]\", line %u: %[^\n]",
225+
rv = sscanf( Line, "\"%[^\"]\", line %lu: %[^\n]",
226226
FileName, &Row, Reason );
227227
Severity = 'e';
228228
ok = ( rv == 3 );
229229
}
230230
Col = (dec_col ? 1 : 0 );
231231
break;
232232
case COMPILER_ATT:
233-
rv = sscanf( Line, "%c \"%[^\"]\",L%u/C%u%*[^:]:%[^\n]",
233+
rv = sscanf( Line, "%c \"%[^\"]\",L%lu/C%lu%*[^:]:%[^\n]",
234234
&Severity, FileName, &Row, &Col, Reason );
235235
ok = ( rv == 5 );
236236

237237
if (rv != 5)
238-
{ rv = sscanf( Line, "%c \"%[^\"]\",L%u/C%u: %[^\n]",
238+
{ rv = sscanf( Line, "%c \"%[^\"]\",L%lu/C%lu: %[^\n]",
239239
&Severity, FileName, &Row, &Col, Reason );
240240
ok = ( rv == 5 );
241241
}
242242

243243
if (rv != 5)
244-
{ rv = sscanf( Line, "%c \"%[^\"]\",L%u: %[^\n]",
244+
{ rv = sscanf( Line, "%c \"%[^\"]\",L%lu: %[^\n]",
245245
&Severity, FileName, &Row, Reason );
246246
ok = ( rv == 4 );
247247
Col = (dec_col ? 1 : 0 );
@@ -272,10 +272,10 @@ int main( int argc, char *argv[] )
272272
}
273273
else
274274
{
275-
rv = sscanf( p+2, "%[^:]: %u: %[^\n]",
275+
rv = sscanf( p+2, "%[^:]: %lu: %[^\n]",
276276
FileName, &Row, Reason );
277277
if (rv != 3)
278-
rv = sscanf( p+2, "%[^,], line %u: %[^\n]",
278+
rv = sscanf( p+2, "%[^,], line %lu: %[^\n]",
279279
FileName, &Row, Reason );
280280
ok = ( rv == 3 );
281281
}
@@ -315,10 +315,10 @@ int main( int argc, char *argv[] )
315315
{
316316
for (p=Reason; (*p) && (isspace(*p)); p++);
317317
if ( BasePath[CWDlen] == 0 )
318-
printf( "%s:%u:%u:%c:%s\n", FileName, Row, Col, Severity, p );
318+
printf( "%s:%lu:%lu:%c:%s\n", FileName, Row, Col, Severity, p );
319319
else
320320
{
321-
printf( "%s/%s:%u:%u:%c:%s\n", &BasePath[CWDlen+1], FileName, Row, Col, Severity, p );
321+
printf( "%s/%s:%lu:%lu:%c:%s\n", &BasePath[CWDlen+1], FileName, Row, Col, Severity, p );
322322
}
323323
}
324324
if (!prefetch)

src/libvterm/src/parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static void append_strbuffer(VTerm *vt, const char *str, size_t len)
6565
{
6666
if(len > vt->parser.strbuffer_len - vt->parser.strbuffer_cur) {
6767
len = vt->parser.strbuffer_len - vt->parser.strbuffer_cur;
68-
DEBUG_LOG1("Truncating strbuffer preserve to %zd bytes\n", len);
68+
DEBUG_LOG1("Truncating strbuffer preserve to %zu bytes\n", len);
6969
}
7070

7171
if(len > 0) {

src/libvterm/src/pen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ INTERNAL void vterm_state_setpen(VTermState *state, const long args[], int argco
387387

388388
if (!done)
389389
{
390-
DEBUG_LOG1("libvterm: Unhandled CSI SGR %lu\n", arg);
390+
DEBUG_LOG1("libvterm: Unhandled CSI SGR %ld\n", arg);
391391
}
392392

393393
while (CSI_ARG_HAS_MORE(args[argi++]))

src/ui.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ clip_start_selection(int col, int row, int repeated_click)
11681168
cb->prev = cb->start;
11691169

11701170
#ifdef DEBUG_SELECTION
1171-
printf("Selection started at (%u,%u)\n", cb->start.lnum, cb->start.col);
1171+
printf("Selection started at (%ld,%d)\n", cb->start.lnum, cb->start.col);
11721172
#endif
11731173
}
11741174

@@ -1203,7 +1203,7 @@ clip_process_selection(
12031203
}
12041204

12051205
#ifdef DEBUG_SELECTION
1206-
printf("Selection ended: (%u,%u) to (%u,%u)\n", cb->start.lnum,
1206+
printf("Selection ended: (%ld,%d) to (%ld,%d)\n", cb->start.lnum,
12071207
cb->start.col, cb->end.lnum, cb->end.col);
12081208
#endif
12091209
if (clip_isautosel_star()
@@ -1347,7 +1347,7 @@ clip_process_selection(
13471347
cb->prev.col = col;
13481348

13491349
#ifdef DEBUG_SELECTION
1350-
printf("Selection is: (%u,%u) to (%u,%u)\n", cb->start.lnum,
1350+
printf("Selection is: (%ld,%d) to (%ld,%d)\n", cb->start.lnum,
13511351
cb->start.col, cb->end.lnum, cb->end.col);
13521352
#endif
13531353
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,8 @@ static char *(features[]) =
742742

743743
static int included_patches[] =
744744
{ /* Add new patch number below this line */
745+
/**/
746+
106,
745747
/**/
746748
105,
747749
/**/

0 commit comments

Comments
 (0)