This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.
The branch, next has been updated
via 6dda67bc5167ad5caa2f93fd95d0405620baf654 (commit)
via 34089d766156c119dc73bea3e85bf5ae451fa23a (commit)
from 3c2fc82b6ee9c451a87e2d3ade2983f9dd1e3999 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/6dda67bc5167ad5caa2f93fd95d0405620baf654
commit 6dda67bc5167ad5caa2f93fd95d0405620baf654
Author: Christophe CURIS <[email protected]>
Date: Sun Jun 9 19:21:16 2013 +0200
wmaker: Added attribute 'noreturn' to appropriate functions
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/event.c b/src/event.c
index 7a1993c..c6951bb 100644
--- a/src/event.c
+++ b/src/event.c
@@ -387,7 +387,7 @@ static void handle_inotify_events(int fd, int wd)
* Calls inotifyGetEvents if defaults database changes.
*----------------------------------------------------------------------
*/
-void EventLoop(void)
+noreturn void EventLoop(void)
{
XEvent event;
#ifdef HAVE_INOTIFY
diff --git a/src/event.h b/src/event.h
index cfc245d..7208b6e 100644
--- a/src/event.h
+++ b/src/event.h
@@ -22,9 +22,15 @@
#ifndef WMEVENT_H
#define WMEVENT_H
+#include "config.h"
+
+#ifdef HAVE_STDNORETURN
+#include <stdnoreturn.h>
+#endif
+
typedef void (WDeathHandler)(pid_t pid, unsigned int status, void *cdata);
-void EventLoop(void);
+noreturn void EventLoop(void);
void DispatchEvent(XEvent *event);
void ProcessPendingEvents(void);
WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata);
diff --git a/src/main.c b/src/main.c
index a0c096e..5497e53 100644
--- a/src/main.c
+++ b/src/main.c
@@ -269,7 +269,7 @@ static int initWVisualID(const char *user_str)
return 0;
}
-void Exit(int status)
+noreturn void Exit(int status)
{
if (dpy)
XCloseDisplay(dpy);
@@ -464,7 +464,7 @@ Bool RelaunchWindow(WWindow *wwin)
*
*----------------------------------------------------------------------
*/
-void wAbort(Bool dumpCore)
+noreturn void wAbort(Bool dumpCore)
{
int i;
WScreen *scr;
diff --git a/src/main.h b/src/main.h
index 2198b74..585ea34 100644
--- a/src/main.h
+++ b/src/main.h
@@ -22,12 +22,18 @@
#ifndef WMMAIN_H_
#define WMMAIN_H_
-void Exit(int status) __attribute__((noreturn));
+#include "config.h"
+
+#ifdef HAVE_STDNORETURN
+#include <stdnoreturn.h>
+#endif
+
+noreturn void Exit(int status);
void Restart(char *manager, Bool abortOnFailure);
void SetupEnvironment(WScreen *scr);
void ExecuteShellCommand(WScreen *scr, char *command);
Bool RelaunchWindow(WWindow *wwin);
-void wAbort(Bool dumpCore);
+noreturn void wAbort(Bool dumpCore);
void ExecExitScript(void);
int getWVisualID(int screen);
http://repo.or.cz/w/wmaker-crm.git/commit/34089d766156c119dc73bea3e85bf5ae451fa23a
commit 34089d766156c119dc73bea3e85bf5ae451fa23a
Author: Christophe CURIS <[email protected]>
Date: Sun Jun 9 19:21:15 2013 +0200
Configure: Added check for compiler attribute 'noreturn'
This attribute for functions was not standard until recently, so
there are a few different possible syntax. With this patch, the
configure script will search for the proper syntax, and define what
is needed to have the attribute compile correctly.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/configure.ac b/configure.ac
index 3feeaae..2f04b02 100644
--- a/configure.ac
+++ b/configure.ac
@@ -247,6 +247,7 @@ dnl
==============================================================
AC_DECL_SYS_SIGLIST
AC_C_CONST
AC_C_INLINE
+WM_C_NORETURN
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_TYPE_SIGNAL
diff --git a/m4/wm_attributes.m4 b/m4/wm_attributes.m4
new file mode 100644
index 0000000..545fe82
--- /dev/null
+++ b/m4/wm_attributes.m4
@@ -0,0 +1,92 @@
+# wm_attributes.m4 - Macros to check compiler attributes and define macros
+#
+# Copyright (c) 2013 Christophe Curis
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# WM_C_NORETURN
+# -------------
+#
+# Checks if the compiler supports ISO C11 noreturn attribute, if not
+# try to define the keyword to a known syntax that does the job, or
+# if nothing works sets it to empty to, at least, be able to
+# compile the sources
+AC_DEFUN_ONCE([WM_C_NORETURN],
+[AC_REQUIRE([_WM_SHELLFN_FUNCATTR])
+AC_CACHE_CHECK([for noreturn], [wm_cv_c_noreturn],
+ [wm_cv_c_noreturn=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [#include <unistd.h>
+#include <stdnoreturn.h>
+
+/* Attribute in the prototype of the function */
+noreturn int test_function(void);
+
+/* Attribute on the function itself */
+noreturn int test_function(void) {
+ _exit(1);
+}
+], [ test_function();])],
+ [wm_cv_c_noreturn=stdnoreturn],
+ [for wm_attr in dnl
+ "__attribute__((noreturn))" dnl for modern GCC-like compilers
+ "__attribute__((__noreturn__))" dnl for older GCC-like compilers
+ "__declspec(noreturn)" dnl for some other compilers
+ ; do
+ AS_IF([wm_fn_c_try_compile_funcattr "$wm_attr"],
+ [wm_cv_c_noreturn="$wm_attr" ; break])
+ done]) dnl
+ ])
+AS_CASE([$wm_cv_c_noreturn],
+ [stdnoreturn],
+ [AC_DEFINE([HAVE_STDNORETURN], 1,
+ [Defined if header "stdnoreturn.h" exists, it defines ISO C11
attribute 'noreturn' and it works])],
+ [no],
+ [AC_DEFINE([noreturn], [],
+ [Defines the attribute to tell the compiler that a function never
returns, if the ISO C11 attribute does not work])],
+ [AC_DEFINE_UNQUOTED([noreturn], [${wm_cv_c_noreturn}],
+ [Defines the attribute to tell the compiler that a function never
returns, if the ISO C11 attribute does not work])])
+])
+
+# _WM_SHELLFN_FUNCATTRIBUTE
+# ----------------------
+# (internal shell function only!)
+#
+# Create a shell function to check if we can compile with special
+# function attributes
+AC_DEFUN([_WM_SHELLFN_FUNCATTR],
+[@%:@ wm_fn_c_try_compile_funcattr ATTRIBUTE
+@%:@ ---------------------------------------
+@%:@ Try compiling a function with the attribute ATTRIBUTE
+wm_fn_c_try_compile_funcattr ()
+{
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [
+/* Attribute in the prototype of the function */
+int test_function(int arg) $[]1;
+
+/* Attribute on the function itself */
+$[]1 int test_function(int arg) {
+ return arg - 1;
+}], [int val;
+val = test_function(1);
+return val;])],
+ [wm_retval=0],
+ [wm_retval=1])
+ AS_SET_STATUS([$wm_retval])
+}
+])
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 1 +
m4/wm_attributes.m4 | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++
src/event.c | 2 +-
src/event.h | 8 ++++-
src/main.c | 4 +-
src/main.h | 10 ++++-
6 files changed, 111 insertions(+), 6 deletions(-)
create mode 100644 m4/wm_attributes.m4
repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
--
wmaker-crm.git ("The Window Maker window manager")
--
To unsubscribe, send mail to [email protected].