From owner-freebsd-hackers Tue Mar 20 11:35:23 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from noc.untraceable.net (noc.untraceable.net [166.84.189.65]) by hub.freebsd.org (Postfix) with ESMTP id 40A5E37B71A for ; Tue, 20 Mar 2001 11:35:19 -0800 (PST) (envelope-from atatat@atatdot.net) Received: (from andrew@localhost) by noc.untraceable.net (8.12.0.Beta5/8.12.0.Beta5/bonk!) id f2KJZ9xg029944; Tue, 20 Mar 2001 14:35:09 -0500 (EST) Date: Tue, 20 Mar 2001 14:35:08 -0500 From: Andrew Brown To: Greywolf Cc: Shankar Agarwal , tech-kern@netbsd.org, bsd hackers Subject: Re: Question regarding the array of size 0. Message-ID: <20010320143508.A29869@noc.untraceable.net> Reply-To: Andrew Brown References: <3AB7A76B.2BCF5D6E@net.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from greywolf@starwolf.com on Tue, Mar 20, 2001 at 11:31:40AM -0800 X-Hi-To-All-My-Friends-In-Domestic-Surveillance: hi there, sports fans :) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Mar 20, 2001 at 11:31:40AM -0800, Greywolf wrote: >On Tue, 20 Mar 2001, Shankar Agarwal wrote: > ># Date: Tue, 20 Mar 2001 10:54:35 -0800 ># From: Shankar Agarwal ># To: tech-kern@netbsd.org ># Cc: bsd hackers ># Subject: Question regarding the array of size 0. ># ># Hi All, ># #define syscallarg(x) \ ># union { \ ># register_t pad; \ ># struct { x datum; } le; \ ># struct { \ ># int8_t pad[ (sizeof (register_t) < sizeof (x)) \ ># ? 0 \ ># : sizeof (register_t) - sizeof (x)]; \ ># x datum; \ ># } be; \ ># } ># ># struct sys_exit_args { ># syscallarg(int) rval; ># }; > >I thought ?: were evaluated at run-time, not compile-time? any halfway decent optimizing compiler ought to be reducing the number of useless constants in its output, this being an example of such. -- |-----< "CODE WARRIOR" >-----| codewarrior@daemon.org * "ah! i see you have the internet twofsonet@graffiti.com (Andrew Brown) that goes *ping*!" andrew@crossbar.com * "information is power -- share the wealth." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message