From owner-freebsd-ports@FreeBSD.ORG Mon Jun 20 19:09:24 2011 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2F3D1065670; Mon, 20 Jun 2011 19:09:24 +0000 (UTC) (envelope-from stephen@missouri.edu) Received: from wilberforce.math.missouri.edu (wilberforce.math.missouri.edu [128.206.184.213]) by mx1.freebsd.org (Postfix) with ESMTP id AB1E08FC1B; Mon, 20 Jun 2011 19:09:24 +0000 (UTC) Received: from [127.0.0.1] (wilberforce.math.missouri.edu [128.206.184.213]) by wilberforce.math.missouri.edu (8.14.4/8.14.4) with ESMTP id p5KJ9Nrv098898; Mon, 20 Jun 2011 14:09:23 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <4DFF9AE3.10609@missouri.edu> Date: Mon, 20 Jun 2011 14:09:23 -0500 From: Stephen Montgomery-Smith User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 MIME-Version: 1.0 To: Chuck Swiger References: <20110620153753.GA41541@freebsd.org> <4DFF73E3.5010405@gmail.com> <4DFF76C7.5070001@missouri.edu> <432743E3-272A-40F5-AF31-6C1805F620F3@mac.com> In-Reply-To: <432743E3-272A-40F5-AF31-6C1805F620F3@mac.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Niclas Zeising , Roman Divacky , "freebsd-ports@freebsd.org" Subject: Re: [ANNOUNCE]: clang compiling ports 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: Mon, 20 Jun 2011 19:09:25 -0000 On 06/20/2011 12:59 PM, Chuck Swiger wrote: > On Jun 20, 2011, at 9:35 AM, Stephen Montgomery-Smith wrote: >> What I would like is a primer on how to suppress all the warnings and errors created by K&R code. > > OK: > > http://clang.llvm.org/docs/UsersManual.html#cl_diagnostics Yes, I did see that. > Of course, you can only suppress warnings; you cannot suppress actual errors. > > clang doesn't currently support -traditional aka pure K&R C. It's possible that compiling with -ansi aka -std=c89 might help-- at least you should get -Wno-implicit-function-declaration and maybe -Wno-implicit-int. > >> Also, why is this an error: >> error: non-void function 'top_button_cross' should return a value [-Wreturn-type] >> when most everything else is a warning. (See http://pointyhat.freebsd.org/errorlogs/amd64-errorlogs/e.9-exp.20110616185105/xppaut-5.99.log.) > > top_button_cross() probably should be declared as returning void. What's presumably happening is that it gets a default return type of int since it doesn't otherwise specify a return type, and then fails to have an explicit return, which is an error. Is a return with no value, from a function of type int, meant to be an error in K&R code? If so, I will change the code so that "return" becomes "return 0". Otherwise, I think the clang compiler should be changed so that this is a warning, not an error. Or at least an error that can be switched off with -Wno-return-type. I will say that I have no desire to put ansii patches into working K&R code. Stephen