This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH]Fix newlib.wctype/twctrans.c compilation warning: implicit declaration of function 'toupper' & 'tolower'
- From: Renlin Li <renlin dot li at arm dot com>
- To: newlib at sourceware dot org
- Cc: Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>
- Date: Wed, 07 Jan 2015 13:43:30 +0000
- Subject: [PATCH]Fix newlib.wctype/twctrans.c compilation warning: implicit declaration of function 'toupper' & 'tolower'
- Authentication-results: sourceware.org; auth=none
- References: <54AD370D dot 9010705 at arm dot com>
Hi all,
Recently, newlib/testsuite/newlib.wctype/twctrans.c fails to build for
the following targets using latest GCC source.
aarch64-none-elf
arm-none-eabi
aarch64_be-none-elf
The following messages are produced:
newlib.wctype/twctrans.c compilation warning: implicit declaration of
function 'toupper' & 'tolower' [-Wimplicit-function-declaration]
Instead, towupper and towloer should be called as wctype.h is included
in the test case.
newlib regresstion test is done using aarch64-none-elf toolchain, no new
issues.
Is it Okay to commit?
newlib/ChangeLog:
2015-01-07 Renlin Li <renlin.li@arm.com>
* testsuite/newlib.wctype/twctrans.c (main): Use towlower and
towupper.diff --git a/newlib/testsuite/newlib.wctype/twctrans.c b/newlib/testsuite/newlib.wctype/twctrans.c
index a70e00175eeb3ec956e7eda2257f6e4f0702b160..5a0c831759855c9c26ec7105611c67b2d1ae7ba2 100644
--- a/newlib/testsuite/newlib.wctype/twctrans.c
+++ b/newlib/testsuite/newlib.wctype/twctrans.c
@@ -8,13 +8,13 @@ int main()
x = wctrans ("tolower");
CHECK (x != 0);
- CHECK (towctrans (L'A', x) == tolower ('A'));
- CHECK (towctrans (L'5', x) == tolower ('5'));
+ CHECK (towctrans (L'A', x) == towlower ('A'));
+ CHECK (towctrans (L'5', x) == towlower ('5'));
x = wctrans ("toupper");
CHECK (x != 0);
- CHECK (towctrans (L'c', x) == toupper ('c'));
- CHECK (towctrans (L'9', x) == toupper ('9'));
+ CHECK (towctrans (L'c', x) == towupper ('c'));
+ CHECK (towctrans (L'9', x) == towupper ('9'));
x = wctrans ("unknown");
CHECK (x == 0);