From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH]-Wstrict-prototypes on SCM_FUNC_CAST_ARBITRARY_ARGS Date: Sat, 14 Feb 2004 10:17:42 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87ptcio6op.fsf@zip.com.au> References: <87llp8zkdy.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1076717972 14228 80.91.224.253 (14 Feb 2004 00:19:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 14 Feb 2004 00:19:32 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Feb 14 01:19:25 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ArnWm-0004lD-00 for ; Sat, 14 Feb 2004 01:19:24 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ArnWf-0008D4-T5 for guile-devel@m.gmane.org; Fri, 13 Feb 2004 19:19:17 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ArnWN-0008A5-Ai for guile-devel@gnu.org; Fri, 13 Feb 2004 19:18:59 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ArnVs-0007tg-4n for guile-devel@gnu.org; Fri, 13 Feb 2004 19:18:57 -0500 Original-Received: from [61.8.0.85] (helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ArnVL-0007eW-Sy; Fri, 13 Feb 2004 19:17:56 -0500 Original-Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87]) by mailout2.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1E0Hr5O007965; Sat, 14 Feb 2004 11:17:53 +1100 Original-Received: from localhost (ppp182.dyn249.pacific.net.au [203.143.249.182]) by mailproxy2.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1E0Hpcg023280; Sat, 14 Feb 2004 11:17:52 +1100 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1ArnV8-0000OO-00; Sat, 14 Feb 2004 10:17:42 +1000 Original-To: Stephen Compall Mail-Copies-To: never User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3372 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3372 Stephen Compall writes: > > Kevin Ryde writes: > > I wonder why a cast is needed at all. I might have thought a > > parameter "SCM (*)()" would be happly passed a function "SCM foo > > (SCM x, SCM y)" or whatever. > > I believe this, however, would eliminate almost all the benefit of > type-checking of function pointers in the first place. I think it would let the return value get checked, which would be advantageous, if it worked. (It'd also do what you want to be safe to -Wstrict-prototypes.) Casting the function pointer (as done now) means it can be anything at all, for instance someone could mistakenly give "void" for the return if they didn't realize it should be an SCM (and return SCM_UNSPECIFIED). With no cast then the return value will have to be right, though of course since the prototype is just "()" for the args they can be anything. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel