From 1912550f6200e9d90c9bc716b7e9e173919b6e2c Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Sun, 28 Sep 2025 14:59:36 -0700 Subject: [PATCH] manual: Fix missing includes in the mbstouwcs example. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Previously this file would fail to compile with the following error: $ gcc manual/examples/mbstouwcs.c manual/examples/mbstouwcs.c: In function ‘mbstouwcs’: manual/examples/mbstouwcs.c:34:11: error: ‘errno’ undeclared (first use in this function) 34 | errno = EILSEQ; | ^~~~~ manual/examples/mbstouwcs.c:5:1: note: ‘errno’ is defined in header ‘’; this is probably fixable by adding ‘#include ’ 4 | #include +++ |+#include 5 | manual/examples/mbstouwcs.c:34:11: note: each undeclared identifier is reported only once for each function it appears in 34 | errno = EILSEQ; | ^~~~~ manual/examples/mbstouwcs.c:34:19: error: ‘EILSEQ’ undeclared (first use in this function) 34 | errno = EILSEQ; | ^~~~~~ manual/examples/mbstouwcs.c:47:20: error: implicit declaration of function ‘towupper’ [-Wimplicit-function-declaration] 47 | *wcp++ = towupper (wc); | ^~~~~~~~ manual/examples/mbstouwcs.c:5:1: note: include ‘’ or provide a declaration of ‘towupper’ 4 | #include +++ |+#include 5 | manual/examples/mbstouwcs.c:47:20: warning: incompatible implicit declaration of built-in function ‘towupper’ [-Wbuiltin-declaration-mismatch] 47 | *wcp++ = towupper (wc); | ^~~~~~~~ manual/examples/mbstouwcs.c:47:20: note: include ‘’ or provide a declaration of ‘towupper’ Reviewed-by: Adhemerval Zanella --- manual/examples/mbstouwcs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manual/examples/mbstouwcs.c b/manual/examples/mbstouwcs.c index c94e1fa7900..c492f37ef21 100644 --- a/manual/examples/mbstouwcs.c +++ b/manual/examples/mbstouwcs.c @@ -1,7 +1,9 @@ +#include #include #include #include #include +#include /* Do not include the above headers in the example. */ -- 2.47.3