From nobody@FreeBSD.org  Tue Dec 25 13:02:01 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id A93E783D
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Dec 2012 13:02:01 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 8FCFE8FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Dec 2012 13:02:01 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qBPD21qG056277
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Dec 2012 13:02:01 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id qBPD21S3056276;
	Tue, 25 Dec 2012 13:02:01 GMT
	(envelope-from nobody)
Message-Id: <201212251302.qBPD21S3056276@red.freebsd.org>
Date: Tue, 25 Dec 2012 13:02:01 GMT
From: Fabian Keil <fk@fabiankeil.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] devel/libowfat fails to build with clang on CURRENT
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         174702
>Category:       ports
>Synopsis:       [PATCH] devel/libowfat fails to build with clang on CURRENT
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lx
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 25 13:10:00 UTC 2012
>Closed-Date:    Thu Feb 07 12:40:14 UTC 2013
>Last-Modified:  Thu Feb 07 12:40:14 UTC 2013
>Originator:     Fabian Keil
>Release:        HEAD
>Organization:
>Environment:
FreeBSD r500.local 10.0-CURRENT FreeBSD 10.0-CURRENT #534 r+98dff01: Mon Dec 24 14:50:32 CET 2012     fk@r500.local:/usr/obj/usr/src/sys/ZOEY  amd64

>Description:
The attached patch lets devel/libowfat build with clang on CURRENT.

Without the patch the build fails with:

In file included from t.c:27:
./CAS.h:56:3: error: void function 'atomic_add' should not return a value [-Wreturn-type]
  return __sync_add_and_fetch(x,val);
  ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~

The patch has been sent to the upstream as well.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

From e162571d6c654644c18c41406f578de0fe601edd Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@fabiankeil.de>
Date: Tue, 25 Dec 2012 13:22:57 +0100
Subject: [PATCH] Fix compilation on FreeBSD 10.0-CURRENT with clang as cc

Previously it failed with:

In file included from t.c:27:
./CAS.h:56:3: error: void function 'atomic_add' should not return a value [-Wreturn-type]
  return __sync_add_and_fetch(x,val);
---
 devel/libowfat/files/patch-CAS.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 devel/libowfat/files/patch-CAS.h

diff --git a/devel/libowfat/files/patch-CAS.h b/devel/libowfat/files/patch-CAS.h
new file mode 100644
index 0000000..75e76c4
--- /dev/null
+++ b/devel/libowfat/files/patch-CAS.h
@@ -0,0 +1,11 @@
+--- CAS.h
++++ CAS.h
+@@ -53,7 +53,7 @@ static inline size_t atomic_add_return(size_t* x,size_t val) {
+ /* *x += val; */
+ static inline void atomic_add(size_t* x,size_t val) {
+ #ifdef USE_BUILTINS
+-  return __sync_add_and_fetch(x,val);
++  __sync_add_and_fetch(x,val);
+ #elif defined(__i386__)
+   asm volatile ("lock; addl %1, %0" : "+m" (*x) : "ir" (val) );
+ #elif defined(__x86_64__)
-- 
1.8.0.2



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->lx 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Dec 25 13:10:18 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174702 
State-Changed-From-To: open->closed 
State-Changed-By: gahr 
State-Changed-When: Thu Feb 7 12:40:13 UTC 2013 
State-Changed-Why:  
Fixed in r311827. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174702 
>Unformatted:
