From owner-freebsd-hackers Tue Mar 20 11:32: 5 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from starwolf.com (starwolf.com [208.184.74.2]) by hub.freebsd.org (Postfix) with ESMTP id 989FA37B71B for ; Tue, 20 Mar 2001 11:32:02 -0800 (PST) (envelope-from greywolf@starwolf.com) Received: from starjumper.starwolf.com (IDENT:greywolf@starjumper [208.184.74.3]) by starwolf.com (8.11.0/8.11.0) with ESMTP id f2KJVZD02718; Tue, 20 Mar 2001 11:31:35 -0800 (PST) Date: Tue, 20 Mar 2001 11:31:40 -0800 (PST) From: Greywolf To: Shankar Agarwal Cc: , bsd hackers Subject: Re: Question regarding the array of size 0. In-Reply-To: <3AB7A76B.2BCF5D6E@net.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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, # I am getting the following array while trying to compile uipc_syscalls.c # file. # /vobs/atm/netbsd/sys/sys/syscallargs.h", line 30: zero or negative # subscript # This is because the code in syscallargs.h is defining an array of size # 0. # The code that is creating problem is # #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? --*greywolf; -- *BSD: The power to Connect To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message