This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]