xenomai.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
To: xenomai@lists.linux.dev
Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Subject: [PATCH v2,1/1] lib/psos/task.c: fix build with gcc >= 12
Date: Sun,  3 Dec 2023 23:17:11 +0100	[thread overview]
Message-ID: <20231203221711.339018-1-fontaine.fabrice@gmail.com> (raw)

Fix the following build failure with gcc >= 12:

task.c: In function 't_start':
task.c:398:16: error: 'ret' may be used uninitialized [-Werror=maybe-uninitialized]
  398 |         return ret;
      |                ^~~
task.c:364:13: note: 'ret' was declared here
  364 |         int ret;
      |             ^~~
task.c: In function 't_resume':
task.c:444:16: error: 'ret' may be used uninitialized [-Werror=maybe-uninitialized]
  444 |         return ret;
      |                ^~~
task.c:428:13: note: 'ret' was declared here
  428 |         int ret;
      |             ^~~

Fixes:
 - http://autobuild.buildroot.org/results/bc1b40de22e563b704ad7f20b6bf4d1f73a6ed8a

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v1 -> v2 (after review of Jan Kiszka):
 - Replace SUCCESS by ERR_OBJDEL

 lib/psos/task.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/psos/task.c b/lib/psos/task.c
index f678be61d..cc7e5c9c4 100644
--- a/lib/psos/task.c
+++ b/lib/psos/task.c
@@ -362,7 +362,7 @@ u_long t_start(u_long tid,
 {
 	struct psos_task *task;
 	struct service svc;
-	int ret;
+	int ret = ERR_OBJDEL;
 
 	CANCEL_DEFER(svc);
 
@@ -426,7 +426,7 @@ u_long t_resume(u_long tid)
 {
 	struct psos_task *task;
 	struct service svc;
-	int ret;
+	int ret = ERR_OBJDEL;
 
 	CANCEL_DEFER(svc);
 
-- 
2.42.0


             reply	other threads:[~2023-12-03 22:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-03 22:17 Fabrice Fontaine [this message]
2023-12-03 22:37 ` [PATCH v2,1/1] lib/psos/task.c: fix build with gcc >= 12 Jan Kiszka
2023-12-04  6:00 ` Florian Bezdeka
2023-12-04  7:47   ` Fabrice Fontaine

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=20231203221711.339018-1-fontaine.fabrice@gmail.com \
    --to=fontaine.fabrice@gmail.com \
    --cc=xenomai@lists.linux.dev \
    /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).