From 3ef81a443a264c48f606dfedd47eb160822457fa Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 3 Apr 2022 15:48:25 -0700 Subject: mark Quit() & QuitAction() as noreturn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clears gcc warnings: xfontsel.c: In function ‘QuitAction’: xfontsel.c:1477:1: warning: function might be candidate for attribute ‘noreturn’ [-Wsuggest-attribute=noreturn] QuitAction(Widget w, XEvent *event, String *params, Cardinal *num_params) ^~~~~~~~~~ xfontsel.c: In function ‘Quit’: xfontsel.c:1392:6: warning: function might be candidate for attribute ‘noreturn’ [-Wsuggest-attribute=noreturn] void Quit(Widget w, XtPointer closure, XtPointer callData) ^~~~ Signed-off-by: Alan Coopersmith --- configure.ac | 2 +- xfontsel.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 85889d7..bf3ad81 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,7 @@ m4_ifndef([XORG_MACROS_VERSION], XORG_MACROS_VERSION(1.8) XORG_DEFAULT_OPTIONS -PKG_CHECK_MODULES(XFONTSEL, xaw7 xmu xt x11) +PKG_CHECK_MODULES(XFONTSEL, xaw7 xmu xt x11 xproto >= 7.0.17) PKG_CHECK_MODULES(APPDEFS, xt) xt_appdefaultdir=`$PKG_CONFIG --variable=appdefaultdir xt` diff --git a/xfontsel.c b/xfontsel.c index 7c12b20..2adf61d 100644 --- a/xfontsel.c +++ b/xfontsel.c @@ -67,7 +67,7 @@ Modified: Mark Leisher to deal with UCS sample text. void GetFontNames(XtPointer closure); Boolean Matches(String pattern, String fontName, Boolean fields[], int *maxfields); Boolean DoWorkPiece(XtPointer closure); -void Quit(Widget w, XtPointer closure, XtPointer callData); +void Quit(Widget w, XtPointer closure, XtPointer callData) _X_NORETURN; void OwnSelection(Widget w, XtPointer closure, XtPointer callData); void SelectField(Widget w, XtPointer closure, XtPointer callData); void ParseFontNames(XtPointer closure); @@ -79,7 +79,8 @@ void AnyValue(Widget w, XtPointer closure, XtPointer callData); void EnableOtherValues(Widget w, XtPointer closure, XtPointer callData); void EnableMenu(XtPointer closure); void SetCurrentFont(XtPointer closure); -void QuitAction(Widget w, XEvent *event, String *params, Cardinal *num_params); +void QuitAction(Widget w, XEvent *event, String *params, Cardinal *num_params) + _X_NORETURN; static XtActionsRec xfontsel_actions[] = { {"Quit", QuitAction} -- cgit v1.2.3