aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2013-11-18 09:27:11 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2013-11-18 09:27:11 +0000
commit74bc175e84798c823fd446be84f1713fe27f3dd8 (patch)
tree56b09670bcf1cc459e61163773c40f30bcbdfdcb
parented97ad4709f095da78aa0a4f5653b9509984d579 (diff)
downloadgcc-74bc175e84798c823fd446be84f1713fe27f3dd8.zip
gcc-74bc175e84798c823fd446be84f1713fe27f3dd8.tar.gz
gcc-74bc175e84798c823fd446be84f1713fe27f3dd8.tar.bz2
re PR libfortran/51828 (libgfortran build warnings)
PR libfortran/51828 * intrinsics/unpack_generic.c (unpack_internal): Let the compiler know that dim > 0 to avoid warnings. From-SVN: r204940
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/intrinsics/unpack_generic.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index c18391f1..fcbc548 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2013-11-18 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR libfortran/51828
+ * intrinsics/unpack_generic.c (unpack_internal): Let the compiler
+ know that dim > 0 to avoid warnings.
+
2013-11-15 Janne Blomqvist <jb@gcc.gnu.org>
Jerry DeLisle <jvdelisle@gcc.gnu.org>
diff --git a/libgfortran/intrinsics/unpack_generic.c b/libgfortran/intrinsics/unpack_generic.c
index d06e0a9..c57914f 100644
--- a/libgfortran/intrinsics/unpack_generic.c
+++ b/libgfortran/intrinsics/unpack_generic.c
@@ -144,6 +144,9 @@ unpack_internal (gfc_array_char *ret, const gfc_array_char *vector,
if (empty)
return;
+ /* This assert makes sure GCC knows we can access *stride[0] later. */
+ assert (dim > 0);
+
vstride0 = GFC_DESCRIPTOR_STRIDE_BYTES(vector,0);
rstride0 = rstride[0];
fstride0 = fstride[0];