2b03926
diff --git a/src/chars.c b/src/chars.c
8e49530
index beb88ca..1d73b81 100644
2b03926
--- a/src/chars.c
2b03926
+++ b/src/chars.c
2b03926
@@ -79,6 +79,16 @@ bool is_byte(int c)
6e31aec
     return ((unsigned int)c == (unsigned char)c);
6e31aec
 }
6e31aec
 
6e31aec
+static void mbtowc_reset(void)
6e31aec
+{
2b03926
+    IGNORE_CALL_RESULT(mbtowc(NULL, NULL, 0));
6e31aec
+}
6e31aec
+
6e31aec
+static void wctomb_reset(void)
6e31aec
+{
2b03926
+    IGNORE_CALL_RESULT(wctomb(NULL, 0));
6e31aec
+}
6e31aec
+
6e31aec
 /* This function is equivalent to isalnum() for multibyte characters. */
6e31aec
 bool is_alnum_mbchar(const char *c)
6e31aec
 {
2b03926
@@ -89,7 +99,7 @@ bool is_alnum_mbchar(const char *c)
6e31aec
 	wchar_t wc;
6e31aec
 
6e31aec
 	if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
8e49530
-	    int shutup = mbtowc(NULL, NULL, 0);
6e31aec
+	    mbtowc_reset();
6e31aec
 	    wc = bad_wchar;
6e31aec
 	}
6e31aec
 
2b03926
@@ -109,7 +119,7 @@ bool is_blank_mbchar(const char *c)
6e31aec
 	wchar_t wc;
6e31aec
 
6e31aec
 	if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
8e49530
-	    int shutup = mbtowc(NULL, NULL, 0);
6e31aec
+	    mbtowc_reset();
6e31aec
 	    wc = bad_wchar;
6e31aec
 	}
6e31aec
 
2b03926
@@ -156,7 +166,7 @@ bool is_cntrl_mbchar(const char *c)
6e31aec
 	wchar_t wc;
6e31aec
 
6e31aec
 	if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
8e49530
-	    int shutup = mbtowc(NULL, NULL, 0);
6e31aec
+	    mbtowc_reset();
6e31aec
 	    wc = bad_wchar;
6e31aec
 	}
6e31aec
 
2b03926
@@ -177,7 +187,7 @@ bool is_punct_mbchar(const char *c)
6e31aec
 	int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
6e31aec
 
6e31aec
 	if (c_mb_len < 0) {
8e49530
-	    int shutup = mbtowc(NULL, NULL, 0);
6e31aec
+	    mbtowc_reset();
6e31aec
 	    wc = bad_wchar;
6e31aec
 	}
6e31aec
 
2b03926
@@ -243,14 +253,14 @@ char *control_mbrep(const char *c, char *crep, int *crep_len)
6e31aec
 	wchar_t wc;
6e31aec
 
6e31aec
 	if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
8e49530
-	    int shutup = mbtowc(NULL, NULL, 0);
6e31aec
+	    mbtowc_reset();
6e31aec
 	    *crep_len = bad_mbchar_len;
6e31aec
 	    strncpy(crep, bad_mbchar, *crep_len);
6e31aec
 	} else {
6e31aec
 	    *crep_len = wctomb(crep, control_wrep(wc));
6e31aec
 
6e31aec
 	    if (*crep_len < 0) {
8e49530
-		int shutup = wctomb(NULL, 0);
6e31aec
+		wctomb_reset();
6e31aec
 		*crep_len = 0;
6e31aec
 	    }
6e31aec
 	}
2b03926
@@ -278,14 +288,14 @@ char *mbrep(const char *c, char *crep, int *crep_len)
6e31aec
 
6e31aec
 	/* Reject invalid Unicode characters. */
6e31aec
 	if (mbtowc(&wc, c, MB_CUR_MAX) < 0 || !is_valid_unicode(wc)) {
8e49530
-	    int shutup = mbtowc(NULL, NULL, 0);
6e31aec
+	    mbtowc_reset();
6e31aec
 	    *crep_len = bad_mbchar_len;
6e31aec
 	    strncpy(crep, bad_mbchar, *crep_len);
6e31aec
 	} else {
6e31aec
 	    *crep_len = wctomb(crep, wc);
6e31aec
 
6e31aec
 	    if (*crep_len < 0) {
8e49530
-		int shutup = wctomb(NULL, 0);
6e31aec
+		wctomb_reset();
6e31aec
 		*crep_len = 0;
6e31aec
 	    }
6e31aec
 	}
2b03926
@@ -311,7 +321,7 @@ int mbwidth(const char *c)
6e31aec
 	int width;
6e31aec
 
6e31aec
 	if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
8e49530
-	    int shutup = mbtowc(NULL, NULL, 0);
6e31aec
+	    mbtowc_reset();
6e31aec
 	    wc = bad_wchar;
6e31aec
 	}
6e31aec
 
2b03926
@@ -356,7 +366,7 @@ char *make_mbchar(long chr, int *chr_mb_len)
6e31aec
 
6e31aec
 	/* Reject invalid Unicode characters. */
6e31aec
 	if (*chr_mb_len < 0 || !is_valid_unicode((wchar_t)chr)) {
8e49530
-	    int shutup = wctomb(NULL, 0);
6e31aec
+	    wctomb_reset();
6e31aec
 	    *chr_mb_len = 0;
6e31aec
 	}
6e31aec
     } else {
2b03926
@@ -388,7 +398,7 @@ int parse_mbchar(const char *buf, char *chr, size_t *col)
6e31aec
 	/* If buf contains an invalid multibyte character, only
6e31aec
 	 * interpret buf's first byte. */
6e31aec
 	if (buf_mb_len < 0) {
8e49530
-	    int shutup = mblen(NULL, 0);
2b03926
+	    IGNORE_CALL_RESULT(mblen(NULL, 0));
6e31aec
 	    buf_mb_len = 1;
6e31aec
 	} else if (buf_mb_len == 0)
6e31aec
 	    buf_mb_len++;
2b03926
@@ -545,7 +555,7 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n)
6e31aec
 	    s1_mb_len = parse_mbchar(s1, s1_mb, NULL);
6e31aec
 
6e31aec
 	    if (mbtowc(&ws1, s1_mb, s1_mb_len) < 0) {
8e49530
-		int shutup = mbtowc(NULL, NULL, 0);
6e31aec
+		mbtowc_reset();
6e31aec
 		ws1 = (unsigned char)*s1_mb;
6e31aec
 		bad_s1_mb = TRUE;
6e31aec
 	    }
2b03926
@@ -553,7 +563,7 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n)
6e31aec
 	    s2_mb_len = parse_mbchar(s2, s2_mb, NULL);
6e31aec
 
6e31aec
 	    if (mbtowc(&ws2, s2_mb, s2_mb_len) < 0) {
8e49530
-		int shutup = mbtowc(NULL, NULL, 0);
6e31aec
+		mbtowc_reset();
6e31aec
 		ws2 = (unsigned char)*s2_mb;
6e31aec
 		bad_s2_mb = TRUE;
6e31aec
 	    }
2b03926
@@ -781,7 +791,7 @@ char *mbstrchr(const char *s, const char *c)
6e31aec
 	int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
6e31aec
 
6e31aec
 	if (c_mb_len < 0) {
8e49530
-	    int shutup = mbtowc(NULL, NULL, 0);
6e31aec
+	    mbtowc_reset();
6e31aec
 	    wc = (unsigned char)*c;
6e31aec
 	    bad_c_mb = TRUE;
6e31aec
 	}
2b03926
@@ -790,7 +800,7 @@ char *mbstrchr(const char *s, const char *c)
6e31aec
 	    int s_mb_len = parse_mbchar(s, s_mb, NULL);
6e31aec
 
6e31aec
 	    if (mbtowc(&ws, s_mb, s_mb_len) < 0) {
8e49530
-		int shutup = mbtowc(NULL, NULL, 0);
6e31aec
+		mbtowc_reset();
6e31aec
 		ws = (unsigned char)*s;
6e31aec
 		bad_s_mb = TRUE;
6e31aec
 	    }
2b03926
diff --git a/src/files.c b/src/files.c
8e49530
index 17eb431..92d6d88 100644
2b03926
--- a/src/files.c
2b03926
+++ b/src/files.c
8e49530
@@ -1092,7 +1092,6 @@ char *get_full_path(const char *origpath)
8e49530
     char *d_here, *d_there, *d_there_file = NULL;
8e49530
     const char *last_slash;
8e49530
     bool path_only;
8e49530
-    int shutup;
8e49530
 
8e49530
     if (origpath == NULL)
8e49530
     	return NULL;
8e49530
@@ -1191,7 +1190,7 @@ char *get_full_path(const char *origpath)
6e31aec
 	    /* Finally, go back to the path specified in d_here,
6e31aec
 	     * where we were before.  We don't check for a chdir()
6e31aec
 	     * error, since we can do nothing if we get one. */
8e49530
-	    shutup = chdir(d_here);
481dc20
+	    IGNORE_CALL_RESULT(chdir(d_here));
481dc20
 
481dc20
 	    /* Free d_here, since we're done using it. */
481dc20
 	    free(d_here);
2b03926
diff --git a/src/nano.h b/src/nano.h
8e49530
index 0cc8f22..2fe383f 100644
2b03926
--- a/src/nano.h
2b03926
+++ b/src/nano.h
8e49530
@@ -54,6 +54,9 @@
8e49530
 #include <stdarg.h>
481dc20
 #endif
481dc20
 
481dc20
+/* Suppress warnings for __attribute__((warn_unused_result)) */
481dc20
+#define IGNORE_CALL_RESULT(call) do { if (call) {} } while(0)
481dc20
+
481dc20
 /* Macros for flags. */
8e49530
 #define FLAGOFF(flag) ((flag) / (sizeof(unsigned) * 8))
8e49530
 #define FLAGMASK(flag) (1 << ((flag) % (sizeof(unsigned) * 8)))