Skip to content

Commit

Permalink
package/xenomai: fix build with gcc >= 12
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Peter Korsgaard <[email protected]>
  • Loading branch information
ffontaine authored and jacmet committed Dec 3, 2023
1 parent f6a7050 commit a3db1dd
Showing 1 changed file with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
From 6c6da9e6d75ccfaa83c1efe14211f080c14181c6 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <[email protected]>
Date: Sun, 3 Dec 2023 15:28:50 +0100
Subject: [PATCH] lib/psos/task.c: fix build with gcc >= 12

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 <[email protected]>
Upstream: https://lore.kernel.org/xenomai/[email protected]/T/#u
---
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..27bcc28a9 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 = SUCCESS;

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 = SUCCESS;

CANCEL_DEFER(svc);

--
2.42.0

0 comments on commit a3db1dd

Please sign in to comment.