On Tue, Dec 07, 2021 at 10:47:35AM -0800, Alan Coopersmith wrote:
> On 12/6/21 11:59 PM, Thomas Klausner wrote:
> > When updating the pkgsrc patches to 1.4.2, I noticed quite a lot of 
> > warnings.
> > Here are patches that remove most.
> 
> Thanks - since we've switched from email to gitlab for patch submission, I've
> converted these to a merge request at:
> https://gitlab.freedesktop.org/xorg/app/xscope/-/merge_requests/5

Oh, I didn't know that. Thanks. I'll take a closer look at that for future 
fixes.

> > ../fd.c: In function ‘MainLoop’:
> > ../fd.c:432:1: warning: function might be candidate for attribute 
> > ‘noreturn’ [-Wsuggest-attribute=noreturn]
> >    432 | MainLoop(void)
> >        | ^~~~~~~~
> > 
> > is unfixed since I could mark it _X_NORETURN but then I'd have to remove
> > the "return 0" at the end too -- is tha tok?
> 
> I think so.

Ok, the attached patch fixes this one as well.
 Thomas
>From 81edca0ce82cc81b997d47e8f42be59649bba149 Mon Sep 17 00:00:00 2001
From: Thomas Klausner <[email protected]>
Date: Tue, 7 Dec 2021 20:47:21 +0100
Subject: [PATCH:xscope] Mark MainLoop as _X_NORETURN.

---
 fd.c | 1 -
 fd.h | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/fd.c b/fd.c
index 8ccdada..9a85f89 100644
--- a/fd.c
+++ b/fd.c
@@ -520,5 +520,4 @@ MainLoop(void)
             }
         }
     }
-    return 0;
 }
diff --git a/fd.h b/fd.h
index a3ddbce..c317aa4 100644
--- a/fd.h
+++ b/fd.h
@@ -98,7 +98,7 @@ extern FD AcceptConnection(FD ConnectionSocket);
 extern FD MakeConnection(const char *server, short port, int report,
                          XtransConnInfo * trans_conn);
 
-extern int MainLoop(void);
+extern int MainLoop(void) _X_NORETURN;
 
 #ifdef USE_XTRANS
 extern XtransConnInfo GetXTransConnInfo(FD fd);
-- 
2.34.1

Reply via email to