Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Mar 2001 10:54:35 -0800
From:      Shankar Agarwal <shankar_agarwal@net.com>
To:        tech-kern@netbsd.org
Cc:        bsd hackers <freebsd-hackers@FreeBSD.ORG>
Subject:   Question regarding the array of size 0.
Message-ID:  <3AB7A76B.2BCF5D6E@net.com>
References:  <Pine.NEB.4.33.0103122044290.498-100000@fiona.amberites.invalid>

next in thread | previous in thread | raw e-mail | index | archive | help
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;
};

struct sys_read_args {
    syscallarg(int) fd;
    syscallarg(void *) buf;
    syscallarg(size_t) nbyte;
};

Can someone pls tell me if it is possible to define an array of size 0.
If yes then do we need some compiler option for this to work. I am not
using the Makefile of FreeBsd and trying to write my own make file which
will work for this code.
Thanks
Regards
Shankar

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?3AB7A76B.2BCF5D6E>