View Issue Details

IDProjectCategoryView StatusLast Update
0000398fileGeneralpublic2022-10-26 18:09
ReporterFabrice Assigned Tochristos  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.43 
Fixed in Version5.44 
Summary0000398: Build failure without wide support (e.g. on uclibc)
DescriptionThe build fails without wide support (e.g. on uclibc) since version 5.43 and
https://github.com/file/file/commit/c80065fe6900be5e794941e29b32440e9969b1c3:

file.c: In function 'fname_print':
file.c:605:10: error: macro "putc" requires 2 arguments, but only 1 given
  605 | putc(c);
      | ^

Full log:
 - http://autobuild.buildroot.org/results/7ff1dd9f79408d2e6286c005302b6f3c505ab259
Additional InformationThe attaced patch will fix the build failure
Tagsbuild, patch

Activities

Fabrice

2022-10-25 22:36

reporter  

0001-src-file.c-fix-build-without-wide-support.patch (1,113 bytes)   
From f2ab09d0e1388657f6b7e62bacc383ebea91f5b9 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Wed, 26 Oct 2022 00:23:32 +0200
Subject: [PATCH] src/file.c: fix build without wide support

Fix the following build failure without wide support (e.g. on uclibc)
raised since version 5.43 and
https://github.com/file/file/commit/c80065fe6900be5e794941e29b32440e9969b1c3:

file.c: In function 'fname_print':
file.c:605:10: error: macro "putc" requires 2 arguments, but only 1 given
  605 |    putc(c);
      |          ^

Fixes:
 - http://autobuild.buildroot.org/results/7ff1dd9f79408d2e6286c005302b6f3c505ab259

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 src/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/file.c b/src/file.c
index f5f46524..1c23defc 100644
--- a/src/file.c
+++ b/src/file.c
@@ -615,7 +615,7 @@ fname_print(const char *inname)
 	for (i = 0; i < n; i++) {
 		unsigned char c = CAST(unsigned char, inname[i]);
 		if (isprint(c)) {
-			putc(c);
+			putc(c, stdout);
 			continue;
 		}
 		file_octal(c);
-- 
2.35.1

christos

2022-10-26 18:09

manager   ~0003853

Thanks!

Issue History

Date Modified Username Field Change
2022-10-25 22:36 Fabrice New Issue
2022-10-25 22:36 Fabrice Tag Attached: build
2022-10-25 22:36 Fabrice Tag Attached: patch
2022-10-25 22:36 Fabrice File Added: 0001-src-file.c-fix-build-without-wide-support.patch
2022-10-26 18:09 christos Assigned To => christos
2022-10-26 18:09 christos Status new => assigned
2022-10-26 18:09 christos Status assigned => resolved
2022-10-26 18:09 christos Resolution open => fixed
2022-10-26 18:09 christos Fixed in Version => 5.44
2022-10-26 18:09 christos Note Added: 0003853