public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Marcin Baczyński" <marbacz@gmail.com>
To: gcc-patches@gcc.gnu.org
Cc: "Marcin Baczyński" <marbacz@gmail.com>
Subject: [PATCH 1/2] Fix warnings reported with -Wreturn-type after patching PR c/48116.
Date: Wed, 01 Jun 2016 11:55:00 -0000	[thread overview]
Message-ID: <20160601115504.725560-1-marbacz@gmail.com> (raw)

libgomp/ChangeLog:

   * fortran.c (omp_set_default_device_, omp_set_default_device_8):
    don't put a void expression in a return,
   * oacc-mem.c (acc_free): likewise,
   * target.c (GOMP_target, GOMP_target_data, GOMP_target_data_ext):
    likewise.
---
 libgomp/fortran.c  |  4 ++--
 libgomp/oacc-mem.c |  5 ++++-
 libgomp/target.c   | 15 ++++++++++++---
 3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/libgomp/fortran.c b/libgomp/fortran.c
index 6b1ef37..1eb9340 100644
--- a/libgomp/fortran.c
+++ b/libgomp/fortran.c
@@ -526,13 +526,13 @@ omp_get_partition_place_nums_8_ (int64_t *place_nums)
 void
 omp_set_default_device_ (const int32_t *device_num)
 {
-  return omp_set_default_device (*device_num);
+  omp_set_default_device (*device_num);
 }
 
 void
 omp_set_default_device_8_ (const int64_t *device_num)
 {
-  return omp_set_default_device (TO_INT (*device_num));
+  omp_set_default_device (TO_INT (*device_num));
 }
 
 int32_t
diff --git a/libgomp/oacc-mem.c b/libgomp/oacc-mem.c
index bd4b62b..87f9435 100644
--- a/libgomp/oacc-mem.c
+++ b/libgomp/oacc-mem.c
@@ -129,7 +129,10 @@ acc_free (void *d)
   struct gomp_device_descr *acc_dev = thr->dev;
 
   if (acc_dev->capabilities & GOMP_OFFLOAD_CAP_SHARED_MEM)
-    return free (d);
+    {
+      free (d);
+      return;
+    }
 
   gomp_mutex_lock (&acc_dev->lock);
 
diff --git a/libgomp/target.c b/libgomp/target.c
index 48b9ab8..bf2fa5f 100644
--- a/libgomp/target.c
+++ b/libgomp/target.c
@@ -1426,7 +1426,10 @@ GOMP_target (int device, void (*fn) (void *), const void *unused,
       /* All shared memory devices should use the GOMP_target_ext function.  */
       || devicep->capabilities & GOMP_OFFLOAD_CAP_SHARED_MEM
       || !(fn_addr = gomp_get_target_fn_addr (devicep, fn)))
-    return gomp_target_fallback (fn, hostaddrs);
+    {
+      gomp_target_fallback (fn, hostaddrs);
+      return;
+    }
 
   struct target_mem_desc *tgt_vars
     = gomp_map_vars (devicep, mapnum, hostaddrs, NULL, sizes, kinds, false,
@@ -1609,7 +1612,10 @@ GOMP_target_data (int device, const void *unused, size_t mapnum,
   if (devicep == NULL
       || !(devicep->capabilities & GOMP_OFFLOAD_CAP_OPENMP_400)
       || (devicep->capabilities & GOMP_OFFLOAD_CAP_SHARED_MEM))
-    return gomp_target_data_fallback ();
+    {
+      gomp_target_data_fallback ();
+      return;
+    }
 
   struct target_mem_desc *tgt
     = gomp_map_vars (devicep, mapnum, hostaddrs, NULL, sizes, kinds, false,
@@ -1628,7 +1634,10 @@ GOMP_target_data_ext (int device, size_t mapnum, void **hostaddrs,
   if (devicep == NULL
       || !(devicep->capabilities & GOMP_OFFLOAD_CAP_OPENMP_400)
       || devicep->capabilities & GOMP_OFFLOAD_CAP_SHARED_MEM)
-    return gomp_target_data_fallback ();
+    {
+      gomp_target_data_fallback ();
+      return;
+    }
 
   struct target_mem_desc *tgt
     = gomp_map_vars (devicep, mapnum, hostaddrs, NULL, sizes, kinds, true,
-- 
2.8.3

             reply	other threads:[~2016-06-01 11:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 11:55 Marcin Baczyński [this message]
2016-06-01 11:55 ` [PATCH] Warn about return with a void expression with -Wreturn-type Marcin Baczyński
2016-06-01 12:07   ` Jakub Jelinek
     [not found]     ` <CALvMQwTZiyrL+KvcFAk20ZYSLk9dDOR+vLJasLhr-C_23WijJA@mail.gmail.com>
2016-06-01 16:39       ` Jakub Jelinek
2016-06-01 17:03         ` Martin Sebor
2016-06-01 18:59           ` Marcin Baczyński
2016-06-02  2:51             ` Martin Sebor
2016-06-02 10:03               ` Marcin Baczyński
2016-06-02 10:03               ` Marcin Baczyński
2016-06-03  9:36                 ` Bernd Schmidt
2016-06-03 10:16                   ` Marcin Baczyński
2016-06-04 20:51                     ` Martin Sebor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160601115504.725560-1-marbacz@gmail.com \
    --to=marbacz@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).