This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
[PATCH] codecvt.h
- To: libstdc++ at sources dot redhat dot com
- Subject: [PATCH] codecvt.h
- From: David Edelsohn <dje at watson dot ibm dot com>
- Date: Mon, 06 Nov 2000 13:40:02 -0500
Both AIX and Glibc declare the second argument to iconv() as
"const char **". The following patch removes the compiler error for me.
Have GNU/Linux systems seen the same errors? I note a lot of ChangeLog
entries for codecvt.h enabling and disabling "const" for this same
function, so this needs some review.
Thanks, David
* include/bits/codecvt.h (do_out, do_in): Constify __cfrom.
Index: codecvt.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/codecvt.h,v
retrieving revision 1.4
diff -c -p -r1.4 codecvt.h
*** codecvt.h 2000/10/31 01:26:05 1.4
--- codecvt.h 2000/11/06 18:31:54
*************** namespace std
*** 393,399 ****
// Argument list for iconv specifies a byte sequence. Thus,
// all to/from arrays must be brutally casted to char*.
char* __cto = reinterpret_cast<char*>(__to);
! char* __cfrom;
size_t __conv;
// Some encodings need a byte order marker as the first item
--- 393,399 ----
// Argument list for iconv specifies a byte sequence. Thus,
// all to/from arrays must be brutally casted to char*.
char* __cto = reinterpret_cast<char*>(__to);
! const char* __cfrom;
size_t __conv;
// Some encodings need a byte order marker as the first item
*************** namespace std
*** 495,501 ****
// Argument list for iconv specifies a byte sequence. Thus,
// all to/from arrays must be brutally casted to char*.
char* __cto = reinterpret_cast<char*>(__to);
! char* __cfrom;
size_t __conv;
// Some encodings need a byte order marker as the first item
--- 495,501 ----
// Argument list for iconv specifies a byte sequence. Thus,
// all to/from arrays must be brutally casted to char*.
char* __cto = reinterpret_cast<char*>(__to);
! const char* __cfrom;
size_t __conv;
// Some encodings need a byte order marker as the first item