From owner-freebsd-ports@FreeBSD.ORG Thu Sep 29 04:58:34 2011 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB9AE106564A for ; Thu, 29 Sep 2011 04:58:34 +0000 (UTC) (envelope-from aehlig@linta.de) Received: from linta.de (isilmar-3.linta.de [188.40.101.200]) by mx1.freebsd.org (Postfix) with ESMTP id 0235B8FC16 for ; Thu, 29 Sep 2011 04:58:33 +0000 (UTC) Received: (qmail 28710 invoked by uid 10); 29 Sep 2011 04:58:31 -0000 Received: from curry.linta.de by isilmar.linta.de with BSMTP; 29 Sep 2011 04:58:31 -0000 Received: by curry.linta.de (Postfix, from userid 1001) id 130C91CC1D; Thu, 29 Sep 2011 05:58:18 +0100 (BST) Date: Thu, 29 Sep 2011 05:58:18 +0100 From: "Klaus T. Aehlig" To: ports@freebsd.org Message-ID: <20110929045818.GA3463@curry.linta.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: ehaupt@FreeBSD.org Subject: clang and configure checking for equivalent simple type X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 04:58:34 -0000 Hallo, while trying to find out why I couldn't build net/socat with clang I found something that might be a general issue, and I wonder what appropriate actions would be. Trying 'cd /usr/ports/net/socat && make CC=clang' failed for me and it turned out that the reason was that the configure script could not find out the 'equivalent simple type of off_t'. Looking at the configure script, one notes that it tries code snippets like #include #include int main () { off_t u; long v; &u==&v; ; return 0; } and check for compile errors. However, the above program is rejected by clang, as the value &u==&v is unused, which, of course, has nothing to do with the intended check whether off_t * and long * are compatible pointer. Adding CFLAGS+= -Wno-unused solves this problem. However, I assume that these kind of tests are quite widespread in configure scripts, so I wonder what to do about this. Possible options include - adding 'CFLAGS+= -Wno-unused' just for this port - do nothing, but recommend users to have -Wno-unused in CFLAGS when using clang (maybe somewhere in the handbook) - check with portmgr@ if adding -Wno-unused to the default CFLAGS (for clang?) is an option - something completely different?? (like: add an appropriate entry to my /etc/make.conf and don't care) Any suggestions? Best, Klaus