Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Mar 2001 14:16:57 -0500 (EST)
From:      der Mouse <mouse@Rodents.Montreal.QC.CA>
To:        Shankar Agarwal <shankar_agarwal@net.com>
Cc:        tech-kern@netbsd.org, freebsd-hackers@FreeBSD.ORG
Subject:   Re: Question regarding the array of size 0.
Message-ID:  <200103201916.OAA08339@Twig.Rodents.Montreal.QC.CA>

next in thread | raw e-mail | index | archive | help
> 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
<sys/syscallargs.h> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103201916.OAA08339>