From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <19c957c9b96a78a95e0c7fb973fd89a8@terzarima.net> To: 9fans@cse.psu.edu Subject: Re: [9fans] 8c's feature or bug? From: Charles Forsyth Date: Thu, 8 Feb 2007 17:33:32 +0000 In-Reply-To: <20070208172808.GA9111@debian> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-recjbfrbdekdbvuadazdztumvq" Topicbox-Message-UUID: 0ef8503c-ead2-11e9-9d60-3106f5b1d025 This is a multi-part message in MIME format. --upas-recjbfrbdekdbvuadazdztumvq Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit you're mixing ANSI prototypes and the original style, and in void f(b) char b; i suspect b is promoted to int, because before prototypes C compilers didn't know an argument was a char at point of call, and chars were promoted to int (similarly float to double), and the function with the argument so promoted clashes with the earlier void f(char). in any case, if you're going to use 8c at all, just commit to ANSI prototypes. in fact, even if you're not going to use 8c, just use ANSI prototypes and either way, avoid or eliminate the ARGS crud. surely it must be at least 20 years old. if the code is imported i suppose it doesn't matter, but if it's new code, using ARGS or __PROTO or whatever is usually just silly. --upas-recjbfrbdekdbvuadazdztumvq Content-Type: message/rfc822 Content-Disposition: inline Received: from mail.cse.psu.edu ([130.203.4.6]) by lavoro; Thu Feb 8 17:18:47 GMT 2007 Received: from psuvax1.cse.psu.edu (localhost [127.0.0.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id D4F4F10B1C for ; Thu, 8 Feb 2007 12:16:29 -0500 (EST) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: from localhost (localhost [127.0.0.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id B56D4FE1A for <9fans@cse.psu.edu>; Thu, 8 Feb 2007 12:15:42 -0500 (EST) Received: from mail.cse.psu.edu ([127.0.0.1]) by localhost (psuvax1 [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06268-01-73 for <9fans@cse.psu.edu>; Thu, 8 Feb 2007 12:15:39 -0500 (EST) Received: from debian (unknown [220.163.74.130]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id A49B3FE61 for <9fans@cse.psu.edu>; Thu, 8 Feb 2007 12:15:39 -0500 (EST) Received: from lee by debian with local (Exim 4.50) id 1HFD45-0002Oa-0a for 9fans@cse.psu.edu; Fri, 09 Feb 2007 01:28:09 +0800 Date: Fri, 9 Feb 2007 01:28:08 +0800 From: Lee Duhem To: 9fans@cse.psu.edu Subject: [9fans] 8c's feature or bug? Message-ID: <20070208172808.GA9111@debian> Mail-Followup-To: 9fans@cse.psu.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: 9fans-bounces+forsyth=terzarima.net@cse.psu.edu Errors-To: 9fans-bounces+forsyth=terzarima.net@cse.psu.edu Hi all, Is this a feature or bug of 8c? Look at this: term% cat t.c #include #include #define ARGS(list) list void foo ARGS((char)); void foo1 ARGS((int)); void main(void) { foo('s'); foo1(1); exits(nil); } void foo (b) char b; { } void foo1 (b) int b; { } term% 8c -FVw t.c t.c:17 function inconsistently declared: foo warning: t.c:17 param declared and not used: b warning: t.c:22 param declared and not used: b My question is: Why I get the "function inconsistently declared" error? or Why I'm not get the same error about foo1? Lee --upas-recjbfrbdekdbvuadazdztumvq--