Fix -Wmaybe-uninitialized warnings.

2014-10-01  Janne Blomqvist  <jb@gcc.gnu.org>

	* 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
This commit is contained in:
Janne Blomqvist 2014-10-01 00:15:58 +03:00
parent 6c02304107
commit b95216f778
16 changed files with 67 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2014-10-01 Janne Blomqvist <jb@gcc.gnu.org>
* 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 <jb@gcc.gnu.org>
* configure.ac (AM_CFLAGS): Add

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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++)
{

View File

@ -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;