From owner-freebsd-hackers Tue Mar 20 11:17:16 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from Twig.Rodents.Montreal.QC.CA (Twig.Rodents.Montreal.QC.CA [216.46.5.3]) by hub.freebsd.org (Postfix) with ESMTP id 0B71937B71C for ; Tue, 20 Mar 2001 11:17:13 -0800 (PST) (envelope-from mouse@Twig.Rodents.Montreal.QC.CA) Received: (from mouse@localhost) by Twig.Rodents.Montreal.QC.CA (8.8.8/8.8.8) id OAA08339; Tue, 20 Mar 2001 14:16:57 -0500 (EST) Date: Tue, 20 Mar 2001 14:16:57 -0500 (EST) From: der Mouse Message-Id: <200103201916.OAA08339@Twig.Rodents.Montreal.QC.CA> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit To: Shankar Agarwal Cc: tech-kern@netbsd.org, freebsd-hackers@FreeBSD.ORG Subject: Re: Question regarding the array of size 0. Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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. > Can someone pls tell me if it is possible to define an array of size > 0. In C, no; in gcc, yes. NetBSD uses gcc. If you expect to build NetBSD code with any other compiler, you may have work to do; this is a simple example. (I've seen nods made in the direction of compatability with other compilers, but they are usually restricted to userland utilities; stuff like that are used only by the kernel get less attention in that direction.) > I am not using the Makefile of FreeBsd I'm not sure why this is relevant; attempting to build NetBSD source code (I note .../netbsd/... in the pathname above, and you asked this on (among others) a NetBSD mailing list) with a FreeBSD Makefile is bound to be an "on your own" sort of thing. > and trying to write my own make file which will work for this code. You will have to either rework it to avoid the zero-size array or switch to using a compiler that supports a C-like language including zero-size arrays (such as gcc). der Mouse mouse@rodents.montreal.qc.ca 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message