From: Janne Blomqvist Date: Tue, 30 Sep 2014 21:15:58 +0000 (+0300) Subject: Fix -Wmaybe-uninitialized warnings. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b95216f77888e79a9b3563be97fbfdc7c67fd9cb;p=gcc.git Fix -Wmaybe-uninitialized warnings. 2014-10-01 Janne Blomqvist * intrinsics/pack_generic.c (pack_s_internal): Fix -Wmaybe-uninitialized warning. * m4/unpack.m4 (unpack0_'rtype_code`): Likewise. (unpack1_'rtype_code`): Likewise. * generated/unpack_*.m4: Regenerated. From-SVN: r215742 --- diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index aac86662797..f8f8c6b54fc 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,11 @@ +2014-10-01 Janne Blomqvist + + * intrinsics/pack_generic.c (pack_s_internal): Fix + -Wmaybe-uninitialized warnings. + * m4/unpack.m4 (unpack0_'rtype_code`): Likewise. + (unpack1_'rtype_code`): Likewise. + * generated/unpack_*.m4: Regenerated. + 2014-09-30 Janne Blomqvist * configure.ac (AM_CFLAGS): Add diff --git a/libgfortran/generated/unpack_c10.c b/libgfortran/generated/unpack_c10.c index 6fc2bdc8796..38a0ea039ba 100644 --- a/libgfortran/generated/unpack_c10.c +++ b/libgfortran/generated/unpack_c10.c @@ -104,6 +104,8 @@ unpack0_c10 (gfc_array_c10 *ret, const gfc_array_c10 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; @@ -249,6 +251,8 @@ unpack1_c10 (gfc_array_c10 *ret, const gfc_array_c10 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; diff --git a/libgfortran/generated/unpack_c16.c b/libgfortran/generated/unpack_c16.c index 443a51eea04..5047511ec38 100644 --- a/libgfortran/generated/unpack_c16.c +++ b/libgfortran/generated/unpack_c16.c @@ -104,6 +104,8 @@ unpack0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; @@ -249,6 +251,8 @@ unpack1_c16 (gfc_array_c16 *ret, const gfc_array_c16 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; diff --git a/libgfortran/generated/unpack_c4.c b/libgfortran/generated/unpack_c4.c index c8b30f5e6d6..52306a3fc8c 100644 --- a/libgfortran/generated/unpack_c4.c +++ b/libgfortran/generated/unpack_c4.c @@ -104,6 +104,8 @@ unpack0_c4 (gfc_array_c4 *ret, const gfc_array_c4 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; @@ -249,6 +251,8 @@ unpack1_c4 (gfc_array_c4 *ret, const gfc_array_c4 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; diff --git a/libgfortran/generated/unpack_c8.c b/libgfortran/generated/unpack_c8.c index 60d9de1b650..ad55b677f2f 100644 --- a/libgfortran/generated/unpack_c8.c +++ b/libgfortran/generated/unpack_c8.c @@ -104,6 +104,8 @@ unpack0_c8 (gfc_array_c8 *ret, const gfc_array_c8 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; @@ -249,6 +251,8 @@ unpack1_c8 (gfc_array_c8 *ret, const gfc_array_c8 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; diff --git a/libgfortran/generated/unpack_i1.c b/libgfortran/generated/unpack_i1.c index 522ce74a9fd..9c87bd6cf11 100644 --- a/libgfortran/generated/unpack_i1.c +++ b/libgfortran/generated/unpack_i1.c @@ -104,6 +104,8 @@ unpack0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; @@ -249,6 +251,8 @@ unpack1_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; diff --git a/libgfortran/generated/unpack_i16.c b/libgfortran/generated/unpack_i16.c index 7e0d1f766d5..ba19a700b2f 100644 --- a/libgfortran/generated/unpack_i16.c +++ b/libgfortran/generated/unpack_i16.c @@ -104,6 +104,8 @@ unpack0_i16 (gfc_array_i16 *ret, const gfc_array_i16 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; @@ -249,6 +251,8 @@ unpack1_i16 (gfc_array_i16 *ret, const gfc_array_i16 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; diff --git a/libgfortran/generated/unpack_i2.c b/libgfortran/generated/unpack_i2.c index b0d21dc246f..7092aae352f 100644 --- a/libgfortran/generated/unpack_i2.c +++ b/libgfortran/generated/unpack_i2.c @@ -104,6 +104,8 @@ unpack0_i2 (gfc_array_i2 *ret, const gfc_array_i2 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; @@ -249,6 +251,8 @@ unpack1_i2 (gfc_array_i2 *ret, const gfc_array_i2 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; diff --git a/libgfortran/generated/unpack_i4.c b/libgfortran/generated/unpack_i4.c index beac1969a5d..2710d6a1def 100644 --- a/libgfortran/generated/unpack_i4.c +++ b/libgfortran/generated/unpack_i4.c @@ -104,6 +104,8 @@ unpack0_i4 (gfc_array_i4 *ret, const gfc_array_i4 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; @@ -249,6 +251,8 @@ unpack1_i4 (gfc_array_i4 *ret, const gfc_array_i4 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; diff --git a/libgfortran/generated/unpack_i8.c b/libgfortran/generated/unpack_i8.c index 75cd2e93fe4..d91780413eb 100644 --- a/libgfortran/generated/unpack_i8.c +++ b/libgfortran/generated/unpack_i8.c @@ -104,6 +104,8 @@ unpack0_i8 (gfc_array_i8 *ret, const gfc_array_i8 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; @@ -249,6 +251,8 @@ unpack1_i8 (gfc_array_i8 *ret, const gfc_array_i8 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; diff --git a/libgfortran/generated/unpack_r10.c b/libgfortran/generated/unpack_r10.c index 926a45777ae..15fa0561521 100644 --- a/libgfortran/generated/unpack_r10.c +++ b/libgfortran/generated/unpack_r10.c @@ -104,6 +104,8 @@ unpack0_r10 (gfc_array_r10 *ret, const gfc_array_r10 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; @@ -249,6 +251,8 @@ unpack1_r10 (gfc_array_r10 *ret, const gfc_array_r10 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; diff --git a/libgfortran/generated/unpack_r16.c b/libgfortran/generated/unpack_r16.c index 6fff184cdfa..8b7ec8dfe8c 100644 --- a/libgfortran/generated/unpack_r16.c +++ b/libgfortran/generated/unpack_r16.c @@ -104,6 +104,8 @@ unpack0_r16 (gfc_array_r16 *ret, const gfc_array_r16 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; @@ -249,6 +251,8 @@ unpack1_r16 (gfc_array_r16 *ret, const gfc_array_r16 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; diff --git a/libgfortran/generated/unpack_r4.c b/libgfortran/generated/unpack_r4.c index c9008745f3a..cc56596bf90 100644 --- a/libgfortran/generated/unpack_r4.c +++ b/libgfortran/generated/unpack_r4.c @@ -104,6 +104,8 @@ unpack0_r4 (gfc_array_r4 *ret, const gfc_array_r4 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; @@ -249,6 +251,8 @@ unpack1_r4 (gfc_array_r4 *ret, const gfc_array_r4 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; diff --git a/libgfortran/generated/unpack_r8.c b/libgfortran/generated/unpack_r8.c index 5999a51ab68..0ead961f946 100644 --- a/libgfortran/generated/unpack_r8.c +++ b/libgfortran/generated/unpack_r8.c @@ -104,6 +104,8 @@ unpack0_r8 (gfc_array_r8 *ret, const gfc_array_r8 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; @@ -249,6 +251,8 @@ unpack1_r8 (gfc_array_r8 *ret, const gfc_array_r8 *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; diff --git a/libgfortran/intrinsics/pack_generic.c b/libgfortran/intrinsics/pack_generic.c index 3fbfa0aaa03..831f396acb9 100644 --- a/libgfortran/intrinsics/pack_generic.c +++ b/libgfortran/intrinsics/pack_generic.c @@ -463,6 +463,9 @@ pack_s_internal (gfc_array_char *ret, const gfc_array_char *array, index_type total; dim = GFC_DESCRIPTOR_RANK (array); + /* Initialize sstride[0] to avoid -Wmaybe-uninitialized + complaints. */ + sstride[0] = size; ssize = 1; for (n = 0; n < dim; n++) { diff --git a/libgfortran/m4/unpack.m4 b/libgfortran/m4/unpack.m4 index e945446d804..271eae2407d 100644 --- a/libgfortran/m4/unpack.m4 +++ b/libgfortran/m4/unpack.m4 @@ -105,6 +105,8 @@ unpack0_'rtype_code` ('rtype` *ret, const 'rtype` *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0; @@ -250,6 +252,8 @@ unpack1_'rtype_code` ('rtype` *ret, const 'rtype` *vector, else { dim = GFC_DESCRIPTOR_RANK (ret); + /* Initialize to avoid -Wmaybe-uninitialized complaints. */ + rstride[0] = 1; for (n = 0; n < dim; n++) { count[n] = 0;