diff mbox series

Fix libgfortran/caf/single.c warnings (PR libgfortran/89593)

Message ID 20190305222914.GF7611@tucnak
State New
Headers show
Series Fix libgfortran/caf/single.c warnings (PR libgfortran/89593) | expand

Commit Message

Jakub Jelinek March 5, 2019, 10:29 p.m. UTC
Hi!

The following patch fixes:
../../../../libgfortran/caf/single.c: In function ‘_gfortran_caf_sendget_by_ref’:
../../../../libgfortran/caf/single.c:2813:57: warning: passing argument 3 of ‘_gfortran_caf_get_by_ref’ from incompatible pointer type [-Wincompatible-pointer-types]
 2813 |   _gfortran_caf_get_by_ref (src_token, src_image_index, &temp, src_refs,
      |                                                         ^~~~~
      |                                                         |
      |                                                         struct <anonymous> *
../../../../libgfortran/caf/single.c:1544:24: note: expected ‘gfc_descriptor_t *’ {aka ‘struct <anonymous> *’} but argument is of type ‘struct <anonymous> *’
 1544 |      gfc_descriptor_t *dst, caf_reference_t *refs,
      |      ~~~~~~~~~~~~~~~~~~^~~
../../../../libgfortran/caf/single.c:2820:58: warning: passing argument 3 of ‘_gfortran_caf_send_by_ref’ from incompatible pointer type [-Wincompatible-pointer-types]
 2820 |   _gfortran_caf_send_by_ref (dst_token, dst_image_index, &temp, dst_refs,
      |                                                          ^~~~~
      |                                                          |
      |                                                          struct <anonymous> *
warnings.  The two functions expect gfc_descriptor_t, which is a type
with flexible array member, but temp is instead with maximum rank.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2019-03-05  Jakub Jelinek  <jakub@redhat.com>

	PR libgfortran/89593
	* caf/single.c (_gfortran_caf_sendget_by_ref): Cast &temp to
	gfc_descriptor_t * to avoid warning.


	Jakub

Comments

Thomas König March 5, 2019, 10:31 p.m. UTC | #1
Hi Jakub,

> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Yes (also could be considered obvious, I guess).

Thanks for the patch!

Regards

	Thomas
diff mbox series

Patch

--- libgfortran/caf/single.c.jj	2019-01-10 16:42:23.719970485 +0100
+++ libgfortran/caf/single.c	2019-03-05 16:39:47.804446703 +0100
@@ -2810,14 +2810,16 @@  _gfortran_caf_sendget_by_ref (caf_token_
   GFC_DESCRIPTOR_RANK (&temp) = -1;
   GFC_DESCRIPTOR_TYPE (&temp) = dst_type;
 
-  _gfortran_caf_get_by_ref (src_token, src_image_index, &temp, src_refs,
+  _gfortran_caf_get_by_ref (src_token, src_image_index,
+			    (gfc_descriptor_t *) &temp, src_refs,
 			    dst_kind, src_kind, may_require_tmp, true,
 			    src_stat, src_type);
 
   if (src_stat && *src_stat != 0)
     return;
 
-  _gfortran_caf_send_by_ref (dst_token, dst_image_index, &temp, dst_refs,
+  _gfortran_caf_send_by_ref (dst_token, dst_image_index,
+			     (gfc_descriptor_t *) &temp, dst_refs,
 			     dst_kind, dst_kind, may_require_tmp, true,
 			     dst_stat, dst_type);
   if (GFC_DESCRIPTOR_DATA (&temp))