From owner-freebsd-arch Fri Feb 1 1:38: 0 2002 Delivered-To: freebsd-arch@freebsd.org Received: from hotmail.com (f81.pav2.hotmail.com [64.4.37.81]) by hub.freebsd.org (Postfix) with ESMTP id B3E7237B41C for ; Fri, 1 Feb 2002 01:37:54 -0800 (PST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 1 Feb 2002 01:37:54 -0800 Received: from 212.226.216.93 by pv2fd.pav2.hotmail.msn.com with HTTP; Fri, 01 Feb 2002 09:37:54 GMT X-Originating-IP: [212.226.216.93] From: "Juha Juntunen" To: arch@FreeBSD.ORG Subject: Re: __P macro question Date: Fri, 01 Feb 2002 11:37:54 +0200 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 01 Feb 2002 09:37:54.0707 (UTC) FILETIME=[1FEF2630:01C1AB04] Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >>>static int sendfile __P((struct printer *pp, int type, char *file, >>> int format)); >>> >>>for a procedure declaration of: >>> static int >>> sendfile(pp, type, file, format) >>> struct printer *pp; >>> int type; >>> char *file; >>> char format; >>> { >> >>That's *EXCATLY* why I'm converting the old, but still legal in c89, >>style to new style. You get warnings that you didn't get before. > >The compiler is broken, if it accepts the second when the >first prototype is in scope. > >It's a broken compiler, period. How is the compiler broken, question mark. Are you perhaps objecting to the type of the last parameter ("int format" vs "char format")? Please see Ansi Classic, chapter "3.5.4.3 Function declarators (including prototypes)", in particular page 69 lines 19-22. In C99, 6.7.5.3 paragraph #11 seems to apply similarly. If you - define "__P" suitably - add "struct printer;" to file scope - add "}" to complete the function definition to me, the above code fragment seems to constitute a valid ANSI C89 translation unit. ++sja _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message