Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jun 2011 10:59:41 -0700
From:      Chuck Swiger <cswiger@mac.com>
To:        Stephen Montgomery-Smith <stephen@missouri.edu>
Cc:        Niclas Zeising <niclas.zeising@gmail.com>, Roman Divacky <rdivacky@freebsd.org>, "freebsd-ports@freebsd.org" <freebsd-ports@freebsd.org>
Subject:   Re: [ANNOUNCE]: clang compiling ports
Message-ID:  <432743E3-272A-40F5-AF31-6C1805F620F3@mac.com>
In-Reply-To: <4DFF76C7.5070001@missouri.edu>
References:  <20110620153753.GA41541@freebsd.org> <4DFF73E3.5010405@gmail.com> <4DFF76C7.5070001@missouri.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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

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.

Regards,
-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?432743E3-272A-40F5-AF31-6C1805F620F3>