View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000383 | file | General | public | 2022-09-25 04:27 | 2022-09-27 19:01 |
| Reporter | delphij | Assigned To | christos | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | resolved | Resolution | fixed | ||
| Platform | arm64 | OS | FreeBSD | OS Version | -CURRENT |
| Product Version | 5.43 | ||||
| Summary | 0000383: printf %lc expects wint_t | ||||
| Description | In src/file.c, fname_print(): wchar_t nextchar; [...] printf("%lc", nextchar); but %lc expects wint_t, and this will cause build breakage for FreeBSD/arm64. | ||||
| Steps To Reproduce | build with -Werror and -Wformat. | ||||
| Tags | No tags attached. | ||||
|
|
0001-file.c-Explicitly-cast-nextchar-to-wint_t-for-printf.patch (775 bytes)
From 488cee2b1db20e53f5c124950d05c5ca85b81500 Mon Sep 17 00:00:00 2001
From: Xin LI <delphij@FreeBSD.org>
Date: Sat, 24 Sep 2022 21:09:52 -0700
Subject: [PATCH] file.c: Explicitly cast 'nextchar' to wint_t for printf(3).
%lc expects an wint_t parameter, while 'nextchar' is wchar_t.
This causes build issues for some FreeBSD platforms.
---
src/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/file.c b/src/file.c
index cb9845a7..4250abbf 100644
--- a/src/file.c
+++ b/src/file.c
@@ -593,7 +593,7 @@ fname_print(const char *inname)
inname += bytesconsumed;
n -= bytesconsumed;
if (iswprint(nextchar)) {
- printf("%lc", nextchar);
+ printf("%lc", (wint_t)nextchar);
continue;
}
/* XXX: What if it is > 255? */
--
2.37.3
|
|
|
fixed, thanks! |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2022-09-25 04:27 | delphij | New Issue | |
| 2022-09-25 04:27 | delphij | File Added: 0001-file.c-Explicitly-cast-nextchar-to-wint_t-for-printf.patch | |
| 2022-09-27 19:01 | christos | Assigned To | => christos |
| 2022-09-27 19:01 | christos | Status | new => assigned |
| 2022-09-27 19:01 | christos | Status | assigned => resolved |
| 2022-09-27 19:01 | christos | Resolution | open => fixed |
| 2022-09-27 19:01 | christos | Note Added: 0003817 |