[PATCH 27/31] more: fix compiler warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Later appers when HAVE_WIDECHAR is not true.

warning: switch missing default case [-Wswitch-default]
warning: 'xmbrtowc' defined but not used [-Wunused-function]

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 text-utils/more.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/text-utils/more.c b/text-utils/more.c
index 7915e90..8cbc62f 100644
--- a/text-utils/more.c
+++ b/text-utils/more.c
@@ -306,6 +306,8 @@ static int check_magic(FILE *f, char *fs)
 			printf(_("\n******** %s: Not a text file ********\n\n"),
 			       fs);
 			return 1;
+		default:
+			break;
 		}
 	}
 	fseek(f, 0L, SEEK_SET);	/* rewind() not necessary */
@@ -592,6 +594,7 @@ static void erase_prompt(struct more_control *ctl, int col)
 	ctl->promptlen = 0;
 }
 
+#ifdef HAVE_WIDECHAR
 static UL_ASAN_BLACKLIST size_t xmbrtowc(wchar_t *wc, const char *s, size_t n,
 				  mbstate_t *mbstate)
 {
@@ -600,6 +603,7 @@ static UL_ASAN_BLACKLIST size_t xmbrtowc(wchar_t *wc, const char *s, size_t n,
 		return 1;
 	return mblength;
 }
+#endif
 
 static int would_underline(char *s, int n)
 {
-- 
2.3.0

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux