Cast "const char *" pointers to "char *" to avoid compiler warnings.

Sebastian Huber sebastian.huber@embedded-brains.de
Fri Oct 5 12:22:00 GMT 2018


On 05/10/2018 11:32, Christophe Lyon wrote:
> commit c6af2b7be0e94935c589307c14eeb9f53901a811
> Author: Christophe Lyon<christophe.lyon@linaro.org>
> Date:   Mon Oct 1 18:53:37 2018 +0000
>
>      Cast "const char *" pointers to "char *" to avoid compiler warnings.
>      
>      2018-10-01  Christophe Lyon<christophe.lyon@linaro.org>
>      
>      	* newlib/libc/ctype/ctype_.c (__set_ctype): Cast "_ctype_" to "char *".
>      	* newlib/libc/locale/locale.c (__loadlocale): Cast "new_locale" to
>      	"char *".

There is a __DECONST() macro in <sys/cdefs.h>. I think this better 
documents the purpose of these casts. It silences also -Wcast-qual warnings.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the Newlib mailing list