summary refs log tree commit diff
path: root/libio/fileops.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-11-03 11:39:56 +0100
committerFlorian Weimer <fweimer@redhat.com>2019-11-13 18:18:51 +0100
commit70c6e15654928c603c6d24bd01cf62e7a8e2ce9b (patch)
tree672e377b91c9fc15f00a15d82cd3f0a2f55fba90 /libio/fileops.c
parent15740788d79447d863b88a5434f09d488d4088d3 (diff)
downloadglibc-70c6e15654928c603c6d24bd01cf62e7a8e2ce9b.tar.gz
glibc-70c6e15654928c603c6d24bd01cf62e7a8e2ce9b.tar.xz
glibc-70c6e15654928c603c6d24bd01cf62e7a8e2ce9b.zip
Redefine _IO_iconv_t to store a single gconv step pointer [BZ #25097]
libio can only deal with gconv conversions which consist of a single
step.  Not using __gconv_info simplifies the data structures somewhat.

This eliminates a new GCC 10 warning about subscribing an inner
zero-length array.

Tested on x86_64-linux-gnu with mainline GCC.  Built with
build-many-glibcs.py, also with mainline GCC.  Due to GCC PR 92039,
there are failures left on 32-bit architectures with float128 support.

Change-Id: I8b4c489b619a53154712ff32e1b6f13bb92d4203
Diffstat (limited to 'libio/fileops.c')
-rw-r--r--libio/fileops.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/libio/fileops.c b/libio/fileops.c
index d84dd7c147..f81646d99c 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -331,23 +331,19 @@ _IO_new_file_fopen (FILE *fp, const char *filename, const char *mode,
 
 	  cc = fp->_codecvt = &fp->_wide_data->_codecvt;
 
-	  cc->__cd_in.__cd.__nsteps = fcts.towc_nsteps;
-	  cc->__cd_in.__cd.__steps = fcts.towc;
-
-	  cc->__cd_in.__cd.__data[0].__invocation_counter = 0;
-	  cc->__cd_in.__cd.__data[0].__internal_use = 1;
-	  cc->__cd_in.__cd.__data[0].__flags = __GCONV_IS_LAST;
-	  cc->__cd_in.__cd.__data[0].__statep = &result->_wide_data->_IO_state;
-
-	  cc->__cd_out.__cd.__nsteps = fcts.tomb_nsteps;
-	  cc->__cd_out.__cd.__steps = fcts.tomb;
-
-	  cc->__cd_out.__cd.__data[0].__invocation_counter = 0;
-	  cc->__cd_out.__cd.__data[0].__internal_use = 1;
-	  cc->__cd_out.__cd.__data[0].__flags
-	    = __GCONV_IS_LAST | __GCONV_TRANSLIT;
-	  cc->__cd_out.__cd.__data[0].__statep =
-	    &result->_wide_data->_IO_state;
+	  cc->__cd_in.step = fcts.towc;
+
+	  cc->__cd_in.step_data.__invocation_counter = 0;
+	  cc->__cd_in.step_data.__internal_use = 1;
+	  cc->__cd_in.step_data.__flags = __GCONV_IS_LAST;
+	  cc->__cd_in.step_data.__statep = &result->_wide_data->_IO_state;
+
+	  cc->__cd_out.step = fcts.tomb;
+
+	  cc->__cd_out.step_data.__invocation_counter = 0;
+	  cc->__cd_out.step_data.__internal_use = 1;
+	  cc->__cd_out.step_data.__flags = __GCONV_IS_LAST | __GCONV_TRANSLIT;
+	  cc->__cd_out.step_data.__statep = &result->_wide_data->_IO_state;
 
 	  /* From now on use the wide character callback functions.  */
 	  _IO_JUMPS_FILE_plus (fp) = fp->_wide_data->_wide_vtable;