[PATCH] codecvt.h

David Edelsohn dje@watson.ibm.com
Mon Nov 6 10:40:00 GMT 2000


	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


More information about the Libstdc++ mailing list