It doesn't look like the code has changed recently so I'm not sure why I never saw this error before. Perhaps Fedora 18's clang became more strict wrt -Wall or -Wextra.

libtool: compile: clang -DHAVE_CONFIG_H -I. -I.. -DLOCALEDIR=\"/usr/lib/locale\" -DRESOURCE_PATH=\"/usr/share/WINGs\" -I../WINGs/WINGs -I../wrlib -I../src -I/usr/include/freetype2 -I/usr/include -g -O0 -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -D_XOPEN_SOURCE=600 -MT proplist.lo -MD -MP -MF .deps/proplist.Tpo -c proplist.c -fPIC -DPIC -o .libs/proplist.o
proplist.c:1165:2: error: non-void function 'WMMergePLDictionaries' should
      return a value [-Wreturn-type]
wassertr(source->type == WPLDictionary && dest->type == WPLDictionary);
        ^
../WINGs/WINGs/WUtil.h:56:9: note: expanded from macro 'wassertr'
        return;\
        ^
proplist.c:1192:2: error: non-void function 'WMSubtractPLDictionaries' should
      return a value [-Wreturn-type]
wassertr(source->type == WPLDictionary && dest->type == WPLDictionary);
        ^
../WINGs/WINGs/WUtil.h:56:9: note: expanded from macro 'wassertr'
        return;\
        ^
2 errors generated.
From 489b41b3847514f19d48e1ebd2521248433b4efd Mon Sep 17 00:00:00 2001
From: Iain Patterson <[email protected]>
Date: Mon, 15 Apr 2013 14:59:12 +0100
Subject: [PATCH] Compiler food.

WMMergePLDictionaries() and WMSubtractPLDictionaries() are declared to
return WMPropList * but are set to call the wassertr macro when their
arguments do not pass a sanity check.  The wassertr macro eventually
calls return with no return value, triggering a compiler warning if
-Wreturn-type is used.

Change wassertr to wassertrv and force a return of NULL in the error
case.
---
 WINGs/proplist.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/WINGs/proplist.c b/WINGs/proplist.c
index 7a80f50..1f50546 100644
--- a/WINGs/proplist.c
+++ b/WINGs/proplist.c
@@ -1162,7 +1162,7 @@ WMPropList *WMMergePLDictionaries(WMPropList * dest, 
WMPropList * source, Bool r
        WMPropList *key, *value, *dvalue;
        WMHashEnumerator e;
 
-       wassertr(source->type == WPLDictionary && dest->type == WPLDictionary);
+       wassertrv(source->type == WPLDictionary && dest->type == WPLDictionary, 
NULL);
 
        if (source == dest)
                return dest;
@@ -1189,7 +1189,7 @@ WMPropList *WMSubtractPLDictionaries(WMPropList * dest, 
WMPropList * source, Boo
        WMPropList *key, *value, *dvalue;
        WMHashEnumerator e;
 
-       wassertr(source->type == WPLDictionary && dest->type == WPLDictionary);
+       wassertrv(source->type == WPLDictionary && dest->type == WPLDictionary, 
NULL);
 
        if (source == dest) {
                WMPropList *keys = WMGetPLDictionaryKeys(dest);
-- 
1.8.1.4

Reply via email to