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  f34e141712fcffc8736cfd20695ee25261046269 (commit)
       via  7f253d9b237aa0a8dccbae6973c5826c34e27c1a (commit)
       via  b2c8de8824c7da3a01939c2dbecda0870a51054f (commit)
       via  bb7103f338226cff4bdbbf2b33623c6c7c4893eb (commit)
       via  e504caf4f24791a8f5d96eaacb09177cae307bca (commit)
       via  920e1d4597471d570cca8c0a64828a3f0365819b (commit)
       via  d532e7efa67e5e237d5aad6c4bcf4a439e839c72 (commit)
       via  5fca55f1072343af1850f8c9c2df99ddf936e343 (commit)
       via  7ebbeb93c115ae1ad0bda5bb4baa11206ad570a6 (commit)
       via  e667bc9fa828619b06c3cdd70aebb475587e8bed (commit)
      from  093cc181fa235a68feb688a1d906ac1244b287ce (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/f34e141712fcffc8736cfd20695ee25261046269

commit f34e141712fcffc8736cfd20695ee25261046269
Author: Christophe CURIS <[email protected]>
Date:   Fri Nov 15 18:46:47 2013 +0100

    Remove some unnecessary code related to XShape usage
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/WINGs/wcolorpanel.c b/WINGs/wcolorpanel.c
index d6bd79c..3b2faaf 100644
--- a/WINGs/wcolorpanel.c
+++ b/WINGs/wcolorpanel.c
@@ -42,12 +42,6 @@
 
 /* BUG There's something fishy with shaped windows */
 /* Whithout shape extension the magnified image is completely broken -Dan */
-#if 0
-# ifdef SHAPE
-#  define SHAPE_WAS_DEFINED
-#  undef SHAPE
-# endif
-#endif
 
 #ifdef SHAPE
 # include <X11/extensions/shape.h>
@@ -3463,8 +3457,3 @@ static unsigned char getShift(unsigned char value)
 
        return i;
 }
-
-#ifdef SHAPE_WAS_DEFINED
-#undef SHAPE_WAS_DEFINED
-#define SHAPE
-#endif
diff --git a/src/screen.c b/src/screen.c
index d40d333..52c164a 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -28,9 +28,6 @@
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/Xatom.h>
-#ifdef SHAPE
-#include <X11/extensions/shape.h>
-#endif
 #ifdef KEEP_XKB_LOCK_STATUS
 #include <X11/XKBlib.h>
 #endif                         /* KEEP_XKB_LOCK_STATUS */

http://repo.or.cz/w/wmaker-crm.git/commit/7f253d9b237aa0a8dccbae6973c5826c34e27c1a

commit 7f253d9b237aa0a8dccbae6973c5826c34e27c1a
Author: Christophe CURIS <[email protected]>
Date:   Fri Nov 15 18:46:46 2013 +0100

    WINGs: Do not create variables for trivial things
    
    In the present case, it just led to a compiler warning on unused variable
    when the XShape extension is disabled, but in general case it just adds
    complexity by duplicating things; this should be reserved for complex
    cases.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/WINGs/dragsource.c b/WINGs/dragsource.c
index 05d2c6a..599b80e 100644
--- a/WINGs/dragsource.c
+++ b/WINGs/dragsource.c
@@ -186,19 +186,16 @@ static Window makeDragIcon(WMScreen * scr, WMPixmap * 
pixmap)
        WMSize size;
        unsigned long flags;
        XSetWindowAttributes attribs;
-       Pixmap pix, mask;
 
        if (!pixmap) {
                pixmap = scr->defaultObjectIcon;
        }
 
        size = WMGetPixmapSize(pixmap);
-       pix = pixmap->pixmap;
-       mask = pixmap->mask;
 
        flags = CWSaveUnder | CWBackPixmap | CWOverrideRedirect | CWColormap;
        attribs.save_under = True;
-       attribs.background_pixmap = pix;
+       attribs.background_pixmap = pixmap->pixmap;
        attribs.override_redirect = True;
        attribs.colormap = scr->colormap;
 
@@ -206,9 +203,8 @@ static Window makeDragIcon(WMScreen * scr, WMPixmap * 
pixmap)
                               size.height, 0, scr->depth, InputOutput, 
scr->visual, flags, &attribs);
 
 #ifdef SHAPE
-
-       if (mask) {
-               XShapeCombineMask(scr->display, window, ShapeBounding, 0, 0, 
mask, ShapeSet);
+       if (pixmap->mask) {
+               XShapeCombineMask(scr->display, window, ShapeBounding, 0, 0, 
pixmap->mask, ShapeSet);
        }
 #endif
 

http://repo.or.cz/w/wmaker-crm.git/commit/b2c8de8824c7da3a01939c2dbecda0870a51054f

commit b2c8de8824c7da3a01939c2dbecda0870a51054f
Author: Christophe CURIS <[email protected]>
Date:   Fri Nov 15 18:46:45 2013 +0100

    wmaker: Do not call XShape function if the server did not say it supports it
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/src/workspace.c b/src/workspace.c
index 1365cc9..5d33fc9 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -371,7 +371,8 @@ static void showWorkspaceName(WScreen * scr, int workspace)
        WMDrawString(scr->wmscreen, text, scr->white, 
w_global.workspace.font_for_name, 2, 2, name, len);
 
 #ifdef SHAPE
-       XShapeCombineMask(dpy, scr->workspace_name, ShapeBounding, 0, 0, mask, 
ShapeSet);
+       if (w_global.xext.shape.supported)
+               XShapeCombineMask(dpy, scr->workspace_name, ShapeBounding, 0, 
0, mask, ShapeSet);
 #endif
        XSetWindowBackgroundPixmap(dpy, scr->workspace_name, text);
        XClearWindow(dpy, scr->workspace_name);

http://repo.or.cz/w/wmaker-crm.git/commit/bb7103f338226cff4bdbbf2b33623c6c7c4893eb

commit bb7103f338226cff4bdbbf2b33623c6c7c4893eb
Author: Christophe CURIS <[email protected]>
Date:   Fri Nov 15 18:46:44 2013 +0100

    wrlib: Added noreturn attribute to appropriate functions
    
    clang is a bit more strict on the attribute usage, so let's comply.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/wrlib/load_jpeg.c b/wrlib/load_jpeg.c
index 815181b..178d5d9 100644
--- a/wrlib/load_jpeg.c
+++ b/wrlib/load_jpeg.c
@@ -31,6 +31,10 @@
 
 #include <jpeglib.h>
 
+#ifdef HAVE_STDNORETURN
+#include <stdnoreturn.h>
+#endif
+
 #include "wraster.h"
 #include "imgformat.h"
 
@@ -76,7 +80,7 @@ typedef struct my_error_mgr *my_error_ptr;
  * Here's the routine that will replace the standard error_exit method:
  */
 
-static void my_error_exit(j_common_ptr cinfo)
+static noreturn void my_error_exit(j_common_ptr cinfo)
 {
        /* cinfo->err really points to a my_error_mgr struct, so coerce pointer 
*/
        my_error_ptr myerr = (my_error_ptr) cinfo->err;

http://repo.or.cz/w/wmaker-crm.git/commit/e504caf4f24791a8f5d96eaacb09177cae307bca

commit e504caf4f24791a8f5d96eaacb09177cae307bca
Author: Christophe CURIS <[email protected]>
Date:   Fri Nov 15 18:46:43 2013 +0100

    WPrefs: Added noreturn attribute to appropriate functions
    
    clang is a bit more strict on the attribute usage, so let's comply.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/WPrefs.app/WPrefs.c b/WPrefs.app/WPrefs.c
index 8f223bc..7afa42e 100644
--- a/WPrefs.app/WPrefs.c
+++ b/WPrefs.app/WPrefs.c
@@ -19,9 +19,15 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#include "config.h"
+
 #include "WPrefs.h"
 #include <assert.h>
 
+#ifdef HAVE_STDNORETURN
+#include <stdnoreturn.h>
+#endif
+
 
 #define ICON_TITLE_FONT "sans serif:pixelsize=9"
 #define ICON_TITLE_VFONT "sans serif:pixelsize=9:weight=100"
@@ -70,7 +76,7 @@ static void savePanelData(Panel * panel);
 
 static void prepareForClose(void);
 
-static void quit(WMWidget *w, void *data)
+static noreturn void quit(WMWidget *w, void *data)
 {
        /* Parameter not used, but tell the compiler that it is ok */
        (void) w;
diff --git a/WPrefs.app/main.c b/WPrefs.app/main.c
index 08dcb58..0d183dd 100644
--- a/WPrefs.app/main.c
+++ b/WPrefs.app/main.c
@@ -18,6 +18,8 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#include "config.h"
+
 #include "WPrefs.h"
 
 #include <assert.h>
@@ -28,6 +30,10 @@
 #include <sys/wait.h>
 #include <unistd.h>
 
+#ifdef HAVE_STDNORETURN
+#include <stdnoreturn.h>
+#endif
+
 char *NOptionValueChanged = "NOptionValueChanged";
 Bool xext_xkb_supported = False;
 
@@ -43,7 +49,7 @@ struct {
 static pid_t DeadChildren[MAX_DEATHS];
 static int DeadChildrenCount = 0;
 
-static void wAbort(Bool foo)
+static noreturn void wAbort(Bool foo)
 {
        /* Parameter not used, but tell the compiler that it is ok */
        (void) foo;

http://repo.or.cz/w/wmaker-crm.git/commit/920e1d4597471d570cca8c0a64828a3f0365819b

commit 920e1d4597471d570cca8c0a64828a3f0365819b
Author: Christophe CURIS <[email protected]>
Date:   Fri Nov 15 18:46:42 2013 +0100

    util: Added noreturn attribute to appropriate functions
    
    clang is a bit more strict on the attribute usage, so let's comply.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/util/convertfonts.c b/util/convertfonts.c
index 4a22fcc..b46594b 100644
--- a/util/convertfonts.c
+++ b/util/convertfonts.c
@@ -23,6 +23,8 @@
 #define _GNU_SOURCE            /* getopt_long */
 #endif
 
+#include "config.h"
+
 #include <sys/stat.h>
 
 #include <getopt.h>
@@ -31,6 +33,10 @@
 #include <stdlib.h>
 #include <string.h>
 
+#ifdef HAVE_STDNORETURN
+#include <stdnoreturn.h>
+#endif
+
 #include <WINGs/WUtil.h>
 
 #include "../src/wconfig.h"
@@ -54,7 +60,7 @@ char *FontOptions[] = {
 extern char *__progname;
 
 
-static void print_help(int print_usage, int exitval)
+static noreturn void print_help(int print_usage, int exitval)
 {
        printf("Usage: %s [-h] [-v] [--keep-xlfd] <style_file>n", __progname);
        if (print_usage) {
diff --git a/util/geticonset.c b/util/geticonset.c
index 98c9b9d..3c9dea8 100644
--- a/util/geticonset.c
+++ b/util/geticonset.c
@@ -23,18 +23,24 @@
 #define _GNU_SOURCE            /* getopt_long */
 #endif
 
+#include "config.h"
+
 #include <getopt.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
+#ifdef HAVE_STDNORETURN
+#include <stdnoreturn.h>
+#endif
+
 #include <WINGs/WUtil.h>
 
 #include "../src/wconfig.h"
 
 extern char *__progname;
 
-static void print_help(int print_usage, int exitval)
+static noreturn void print_help(int print_usage, int exitval)
 {
        printf("Usage: %s [-h] [-v] [file]n", __progname);
        if (print_usage) {
diff --git a/util/getstyle.c b/util/getstyle.c
index ad7a493..66548e7 100644
--- a/util/getstyle.c
+++ b/util/getstyle.c
@@ -23,6 +23,8 @@
 #define _GNU_SOURCE            /* getopt_long */
 #endif
 
+#include "config.h"
+
 #include <sys/types.h>
 #include <sys/stat.h>
 
@@ -38,6 +40,10 @@
 #include <strings.h>
 #include <unistd.h>
 
+#ifdef HAVE_STDNORETURN
+#include <stdnoreturn.h>
+#endif
+
 #include <WINGs/WUtil.h>
 
 #include "common.h"
@@ -138,7 +144,7 @@ WMPropList *PixmapPath = NULL;
 char *ThemePath = NULL;
 
 
-static void print_help(int print_usage, int exitval)
+static noreturn void print_help(int print_usage, int exitval)
 {
        printf("Usage: %s [-t] [-p] [-h] [-v] [file]n", __progname);
        if (print_usage) {
diff --git a/util/seticons.c b/util/seticons.c
index b64d168..bf741fd 100644
--- a/util/seticons.c
+++ b/util/seticons.c
@@ -23,18 +23,24 @@
 #define _GNU_SOURCE            /* getopt_long */
 #endif
 
+#include "config.h"
+
 #include <getopt.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
+#ifdef HAVE_STDNORETURN
+#include <stdnoreturn.h>
+#endif
+
 #include <WINGs/WUtil.h>
 
 #include "../src/wconfig.h"
 
 extern char *__progname;
 
-static void print_help(int print_usage, int exitval)
+static noreturn void print_help(int print_usage, int exitval)
 {
        printf("Usage: %s [-h] [-v] [file]n", __progname);
        if (print_usage) {
diff --git a/util/setstyle.c b/util/setstyle.c
index 80b9e1d..451589c 100644
--- a/util/setstyle.c
+++ b/util/setstyle.c
@@ -23,6 +23,8 @@
 #define _GNU_SOURCE            /* getopt_long */
 #endif
 
+#include "config.h"
+
 #include <sys/stat.h>
 
 #include <getopt.h>
@@ -34,6 +36,10 @@
 #include <unistd.h>
 #include <X11/Xlib.h>
 
+#ifdef HAVE_STDNORETURN
+#include <stdnoreturn.h>
+#endif
+
 #include <WINGs/WUtil.h>
 
 #include "../src/wconfig.h"
@@ -350,7 +356,7 @@ static void hackStyle(WMPropList * style)
        }
 }
 
-static void print_help(int print_usage, int exitval)
+static noreturn void print_help(int print_usage, int exitval)
 {
        printf("Usage: %s [OPTIONS] FILEn", __progname);
        if (print_usage) {
diff --git a/util/wdread.c b/util/wdread.c
index 832b1f6..a227817 100644
--- a/util/wdread.c
+++ b/util/wdread.c
@@ -27,6 +27,7 @@
 /*
  * WindowMaker defaults DB reader
  */
+#include "config.h"
 
 #include <getopt.h>
 #include <limits.h>
@@ -35,13 +36,17 @@
 #include <string.h>
 #include <unistd.h>
 
+#ifdef HAVE_STDNORETURN
+#include <stdnoreturn.h>
+#endif
+
 #include <WINGs/WUtil.h>
 
 #include "../src/wconfig.h"
 
 extern char *__progname;
 
-static void print_help(int print_usage, int exitval)
+static noreturn void print_help(int print_usage, int exitval)
 {
        printf("Usage: %s [OPTIONS] <domain> <key>n", __progname);
        if (print_usage) {
diff --git a/util/wdwrite.c b/util/wdwrite.c
index a2bb61f..3578d07 100644
--- a/util/wdwrite.c
+++ b/util/wdwrite.c
@@ -26,7 +26,7 @@
 /*
  * WindowMaker defaults DB writer
  */
-
+#include "config.h"
 
 #include <getopt.h>
 #include <limits.h>
@@ -35,13 +35,17 @@
 #include <string.h>
 #include <unistd.h>
 
+#ifdef HAVE_STDNORETURN
+#include <stdnoreturn.h>
+#endif
+
 #include <WINGs/WUtil.h>
 
 #include "../src/wconfig.h"
 
 extern char *__progname;
 
-static void print_help(int print_usage, int exitval)
+static noreturn void print_help(int print_usage, int exitval)
 {
        printf("Usage: %s [OPTIONS] <domain> <key> <value>n", __progname);
        if (print_usage) {
diff --git a/util/wmgenmenu.c b/util/wmgenmenu.c
index 0dc5810..b043feb 100644
--- a/util/wmgenmenu.c
+++ b/util/wmgenmenu.c
@@ -4,6 +4,8 @@
 #define _GNU_SOURCE            /* getopt_long */
 #endif
 
+#include "config.h"
+
 #include <ctype.h>
 #include <getopt.h>
 #include <limits.h>
@@ -12,6 +14,10 @@
 #include <stdlib.h>
 #include <string.h>
 
+#ifdef HAVE_STDNORETURN
+#include <stdnoreturn.h>
+#endif
+
 #include <WINGs/WUtil.h>
 
 #include "../src/wconfig.h"
@@ -477,7 +483,7 @@ static void other_window_managers(void)
                WMAddToPLArray(RMenu, L1Menu);
 }
 
-void print_help(int print_usage, int exitval)
+noreturn void print_help(int print_usage, int exitval)
 {
        printf("Usage: %s [-h] [-v]n", __progname);
        if (print_usage) {
diff --git a/util/wmsetbg.c b/util/wmsetbg.c
index ead3229..22653af 100644
--- a/util/wmsetbg.c
+++ b/util/wmsetbg.c
@@ -24,6 +24,8 @@
 /*
  * TODO: rewrite, too dirty
  */
+#include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -37,8 +39,6 @@
 #include <sys/types.h>
 #include <ctype.h>
 
-#include "../config.h"
-
 #ifdef XINERAMA
 # ifdef SOLARIS_XINERAMA       /* sucks */
 #  include <X11/extensions/xinerama.h>
@@ -47,6 +47,10 @@
 # endif
 #endif
 
+#ifdef HAVE_STDNORETURN
+#include <stdnoreturn.h>
+#endif
+
 #include "../src/wconfig.h"
 
 #ifndef GLOBAL_DEFAULTS_SUBDIR
@@ -880,7 +884,7 @@ static int readmsg(int fd, char *buffer, int size)
  * n is 4 bytes
  * size = 4 bytes for length of the message data
  */
-static void helperLoop(RContext * rc)
+static noreturn void helperLoop(RContext * rc)
 {
        BackgroundTexture *textures[WORKSPACE_COUNT];
        int maxTextures = 0;

http://repo.or.cz/w/wmaker-crm.git/commit/d532e7efa67e5e237d5aad6c4bcf4a439e839c72

commit d532e7efa67e5e237d5aad6c4bcf4a439e839c72
Author: Christophe CURIS <[email protected]>
Date:   Fri Nov 15 18:46:41 2013 +0100

    util: Removed unused procedure that caused a compilation warning
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/util/wmsetbg.c b/util/wmsetbg.c
index 742f7b0..ead3229 100644
--- a/util/wmsetbg.c
+++ b/util/wmsetbg.c
@@ -1125,12 +1125,6 @@ static char *getFullPixmapPath(const char *file)
        return wstrdup(file);
 }
 
-void wAbort(void)
-{
-       wfatal("aborting");
-       exit(1);
-}
-
 static void print_help(void)
 {
        printf("Usage: %s [options] [image]n", __progname);

http://repo.or.cz/w/wmaker-crm.git/commit/5fca55f1072343af1850f8c9c2df99ddf936e343

commit 5fca55f1072343af1850f8c9c2df99ddf936e343
Author: Christophe CURIS <[email protected]>
Date:   Fri Nov 15 18:46:40 2013 +0100

    WINGs: Added attribute 'noreturn' to public function 'WMScreenMainLoop'
    
    As suggested by GCC, this function is a good candidate. There is a little
    constraint on how to do it however, as it is part of the public API so we
    have to do it in a portable fashion (We can't rely on our "config.h" when
    the file will have been installed).
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/WINGs/WINGs/WINGs.h b/WINGs/WINGs/WINGs.h
index 0104e03..d3b4f28 100644
--- a/WINGs/WINGs/WINGs.h
+++ b/WINGs/WINGs/WINGs.h
@@ -26,7 +26,7 @@
 #include <WINGs/WUtil.h>
 #include <X11/Xlib.h>
 
-#define WINGS_H_VERSION  20041030
+#define WINGS_H_VERSION  20131115
 
 
 #ifdef __cplusplus
@@ -37,6 +37,22 @@ extern "C" {
 #endif
 
 
+#ifdef __STDC_VERSION__
+# if __STDC_VERSION__ >= 201112L
+/*
+ * Ideally, we would like to include the proper header to have 'noreturn' 
properly
+ * defined (that's what is done for the rest of the code)
+ * However, as we're a public API file we can't do that in a portable fashion, 
so
+ * we just stick to plain STD C11 keyword
+ */
+#  define _wings_noreturn _Noreturn
+# else
+#  define _wings_noreturn /**/
+# endif
+#else
+#define _wings_noreturn /**/
+#endif
+
 typedef unsigned long WMPixel;
 
 
@@ -648,7 +664,7 @@ WMScreen* WMCreateScreen(Display *display, int screen);
 
 WMScreen* WMCreateSimpleApplicationScreen(Display *display);
 
-void WMScreenMainLoop(WMScreen *scr);
+_wings_noreturn void WMScreenMainLoop(WMScreen *scr);
 
 void WMBreakModalLoop(WMScreen *scr);
 
@@ -1859,5 +1875,9 @@ void W_setconf_doubleClickDelay(int value);
 }
 #endif /* __cplusplus */
 
-#endif
 
+/* These definitions are not meant to be seen outside this file */
+#undef _wings_noreturn
+
+
+#endif

http://repo.or.cz/w/wmaker-crm.git/commit/7ebbeb93c115ae1ad0bda5bb4baa11206ad570a6

commit 7ebbeb93c115ae1ad0bda5bb4baa11206ad570a6
Author: Christophe CURIS <[email protected]>
Date:   Fri Nov 15 18:46:39 2013 +0100

    configure: Enable compiler warnings to help add 'noreturn' attribute
    
    This attributes helps the compiler to produce better binary code.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/configure.ac b/configure.ac
index 81ff837..d995e63 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,6 +135,10 @@ AS_IF([test "x$debug" = "xyes"],
          [-Wsuggest-attribute=format  dnl new gcc syntax
           -Wmissing-format-attribute  dnl old gcc syntax, clang
          ])
+     WM_CFLAGS_CHECK_FIRST([no-return attribute suggest],
+         [-Wsuggest-attribute=noreturn  dnl gcc syntax
+          -Wmissing-noreturn            dnl clang syntax
+         ])
 ], [dnl
      dnl When debug not enabled, we try to avoid some non-necessary
      dnl messages from the compiler

http://repo.or.cz/w/wmaker-crm.git/commit/e667bc9fa828619b06c3cdd70aebb475587e8bed

commit e667bc9fa828619b06c3cdd70aebb475587e8bed
Author: Christophe CURIS <[email protected]>
Date:   Fri Nov 15 18:46:38 2013 +0100

    configure: Enable compiler warnings to help add 'format' attribute
    
    This attribute helps the compiler checking the type matching between
    arguments and the specification in a printf-like format string, to
    avoid invalid output. This attribute is optional, but some compilers
    can suggest functions that could have it.
    
    This patch adds the appropriate compiler flags if they are supported when
    the source is being compiled with DEBUG enabled.
    
    The patch also introduces a new macro WM_CFLAGS_CHECK_FIRST because in some
    cases AX_CFLAGS_GCC_OPTION is not really efficient and in present case it
    does not fits the job.
    
    Signed-off-by: Christophe CURIS <[email protected]>

diff --git a/configure.ac b/configure.ac
index bbcdcbb..81ff837 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,6 +129,12 @@ AS_IF([test "x$debug" = "xyes"],
      dnl Having more than 1 prototype for a function makes code updates
      dnl more difficult, so try to avoid it
      AX_CFLAGS_GCC_OPTION([-Wredundant-decls])
+     dnl
+     dnl Proper attributes helps the compiler to produce better code
+     WM_CFLAGS_CHECK_FIRST([format attribute suggest],
+         [-Wsuggest-attribute=format  dnl new gcc syntax
+          -Wmissing-format-attribute  dnl old gcc syntax, clang
+         ])
 ], [dnl
      dnl When debug not enabled, we try to avoid some non-necessary
      dnl messages from the compiler
diff --git a/m4/wm_cflags_check.m4 b/m4/wm_cflags_check.m4
new file mode 100644
index 0000000..d46511a
--- /dev/null
+++ b/m4/wm_cflags_check.m4
@@ -0,0 +1,77 @@
+# wm_cflags_check.m4 - Macros to check options for the compiler into CFLAGS
+#
+# 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_CFLAGS_CHECK_FIRST
+# ---------------------
+#
+# For each option provided, check which one is supported and stops when
+# found, adding it to CFLAGS. It extends AX_CFLAGS_GCC_OPTION which does
+# not checks for fallbacks; as a bonus it uses a shared function to
+# produce smaller configure script.
+#
+# Usage: WM_CFLAGS_CHECK_FIRST([message], [option alt_option...])
+#   $1 message: required, message displayed in 'Checking for...'
+#   $2 option_list: list of options, tested in given order
+#
+# The first option that works is added to CFLAGS
+AC_DEFUN([WM_CFLAGS_CHECK_FIRST],
+[AC_REQUIRE([_WM_SHELLFN_CHKCFLAGS])
+m4_define([_wm_optlist], m4_split([$2]))dnl
+AS_VAR_PUSHDEF([VAR], [wm_cv_c_check_compopt[]m4_car(_wm_optlist)])dnl
+m4_define([_wm_trimmed_optlist], m4_join([ ], _wm_optlist))dnl
+AC_CACHE_CHECK([CFLAGS for m4_ifnblank($1,$1,m4_car(_wm_optlist))], VAR,
+  [VAR="no, unknown"
+   for wm_option in _wm_trimmed_optlist ; do
+     AS_IF([wm_fn_c_try_compile_cflag "$wm_option"],
+           [VAR="$wm_option" ; break])
+   done])
+AS_CASE([$VAR],
+  [no,*], [],
+  [AS_IF([echo " $CFLAGS " | grep " $VAR " 2>&1 > /dev/null],
+    [AC_MSG_WARN([option $VAR already present in $CFLAGS, not appended])],
+    [CFLAGS="$CFLAGS $VAR"]) ])
+AS_VAR_POPDEF([VAR])dnl
+m4_undefine([_wm_optlist])dnl
+m4_undefine([_wm_trimmed_optlist])dnl
+])
+
+
+# _WM_SHELLFN_CHKCFLAGS
+# ---------------------
+# (internal shell function)
+#
+# Create a shell function that tries compiling a simple program with the
+# specified compiler option. Assumes the current compilation language is
+# already set to C
+AC_DEFUN_ONCE([_WM_SHELLFN_CHKCFLAGS],
+[@%:@ wm_fn_c_try_compile_cflag CC_OPTION
+@%:@ -----------------------------------
+@%:@ Try compiling a function using CC_OPTION in the compiler's options
+wm_fn_c_try_compile_cflag ()
+{
+  wm_save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -Werror $[]1"
+  AC_COMPILE_IFELSE(
+    [AC_LANG_PROGRAM([], [])],
+    [wm_retval=0],
+    [wm_retval=1])
+  CFLAGS="$wm_save_CFLAGS"
+  AS_SET_STATUS([$wm_retval])
+}
+])

-----------------------------------------------------------------------

Summary of changes:
 WINGs/WINGs/WINGs.h   |   26 ++++++++++++++--
 WINGs/dragsource.c    |   10 ++----
 WINGs/wcolorpanel.c   |   11 -------
 WPrefs.app/WPrefs.c   |    8 ++++-
 WPrefs.app/main.c     |    8 ++++-
 configure.ac          |   10 ++++++
 m4/wm_cflags_check.m4 |   77 +++++++++++++++++++++++++++++++++++++++++++++++++
 src/screen.c          |    3 --
 src/workspace.c       |    3 +-
 util/convertfonts.c   |    8 ++++-
 util/geticonset.c     |    8 ++++-
 util/getstyle.c       |    8 ++++-
 util/seticons.c       |    8 ++++-
 util/setstyle.c       |    8 ++++-
 util/wdread.c         |    7 ++++-
 util/wdwrite.c        |    8 ++++-
 util/wmgenmenu.c      |    8 ++++-
 util/wmsetbg.c        |   16 ++++------
 wrlib/load_jpeg.c     |    6 +++-
 19 files changed, 195 insertions(+), 46 deletions(-)
 create mode 100644 m4/wm_cflags_check.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].

Reply via email to