Re: A few questions about a few includes

2002-03-06 Thread Tony Finch
Lowell Gilbert [EMAIL PROTECTED] wrote: C-99 requires a fully specified type before the unspecified array (and requires said array to be the last element in the structure). So this example is *not* valid in C99, but the following would be: struct foo { int bar; char array[]; };

Re: A few questions about a few includes

2002-03-04 Thread Harti Brandt
On Sun, 3 Mar 2002, Erik Trulsson wrote: ETOn Sun, Mar 03, 2002 at 10:27:17AM -0700, Ian wrote: ET ET In sys/proc.h: ET ET /* ET * pargs, used to hold a copy of the command line, if it had a sane ET * length ET */ ET struct pargs { ET u_int ar_ref; /* Reference count */ ET

Re: A few questions about a few includes

2002-03-04 Thread Erik Trulsson
On Mon, Mar 04, 2002 at 10:29:18AM +0100, Harti Brandt wrote: On Sun, 3 Mar 2002, Erik Trulsson wrote: ETOn Sun, Mar 03, 2002 at 10:27:17AM -0700, Ian wrote: ET ET In sys/proc.h: ET ET /* ET * pargs, used to hold a copy of the command line, if it had a sane ET * length ET */ ET

Re: A few questions about a few includes

2002-03-04 Thread M. Warner Losh
In message: [EMAIL PROTECTED] Erik Trulsson [EMAIL PROTECTED] writes: : I think it is still there (and my draft copy says the same thing). : I was thinking about the original C89 standard which does not allow it : (and does not allow incomplete array types in structs). Guess I

Re: A few questions about a few includes

2002-03-04 Thread Harti Brandt
On Mon, 4 Mar 2002, M. Warner Losh wrote: MWLIn message: [EMAIL PROTECTED] MWLErik Trulsson [EMAIL PROTECTED] writes: MWL: I think it is still there (and my draft copy says the same thing). MWL: I was thinking about the original C89 standard which does not allow it MWL: (and does not

Re: Re: A few questions about a few includes

2002-03-04 Thread Erik Trulsson
On Mon, Mar 04, 2002 at 09:35:29AM -0700, M. Warner Losh wrote: In message: [EMAIL PROTECTED] Erik Trulsson [EMAIL PROTECTED] writes: : I think it is still there (and my draft copy says the same thing). : I was thinking about the original C89 standard which does not allow it :

Re: A few questions about a few includes

2002-03-04 Thread Lowell Gilbert
Erik Trulsson [EMAIL PROTECTED] writes: On Mon, Mar 04, 2002 at 09:35:29AM -0700, M. Warner Losh wrote: In message: [EMAIL PROTECTED] Erik Trulsson [EMAIL PROTECTED] writes: : I think it is still there (and my draft copy says the same thing). : I was thinking about the

Re: A few questions about a few includes

2002-03-04 Thread Lowell Gilbert
Harti Brandt [EMAIL PROTECTED] writes: This should be struct foo { char array[]; }; according to C-99, on which gcc2 barfs. Don't know, whether gcc3 can handle this. C-99 requires a fully specified type before the unspecified array (and requires said array to be the last element

A few questions about a few includes

2002-03-03 Thread Conrad Sabatier
Am I just completely stupid, or do we have a few things that could use a little cleaning up in /usr/include as well as in the man page for kvm_*? System: FreeBSD 4.5-STABLE 1) The man page for the kvm_* functions lists the following #include dependencies: #include kvm.h #include

Re: A few questions about a few includes

2002-03-03 Thread Ian
In sys/proc.h: /* * pargs, used to hold a copy of the command line, if it had a sane * length */ struct pargs { u_int ar_ref; /* Reference count */ u_int ar_length; /* Length */ u_char ar_args[0]; /* Arguments */ }; This does indeed seem to make little or

Re: A few questions about a few includes

2002-03-03 Thread Erik Trulsson
On Sun, Mar 03, 2002 at 10:27:17AM -0700, Ian wrote: In sys/proc.h: /* * pargs, used to hold a copy of the command line, if it had a sane * length */ struct pargs { u_int ar_ref; /* Reference count */ u_int ar_length; /* Length */ u_char ar_args[0];

Re: A few questions about a few includes

2002-03-03 Thread Brian T . Schellenberger
On Sunday 03 March 2002 10:19 am, Conrad Sabatier wrote: Am I just completely stupid, or do we have a few things that could use a little cleaning up in /usr/include as well as in the man page for kvm_*? System: FreeBSD 4.5-STABLE 2) If compiling with the -pedantic switch, one might see

Re: A few questions about a few includes

2002-03-03 Thread Brian T . Schellenberger
On Sunday 03 March 2002 01:00 pm, Erik Trulsson wrote: On Sun, Mar 03, 2002 at 10:27:17AM -0700, Ian wrote: In sys/proc.h: /* * pargs, used to hold a copy of the command line, if it had a sane * length */ struct pargs { u_int ar_ref; /* Reference count */

Re: A few questions about a few includes

2002-03-03 Thread Terry Lambert
Brian T.Schellenberger wrote: I can't even imagine how one *would* write a compiler where this would fail--does anybody know the putative risk that led ANSI to ban this (IMHO) perfectly-reasonable bahvior? Order of structure elements is undefined. Zero length arrays are undefined. Also,

Re: A few questions about a few includes

2002-03-03 Thread Greg Black
Terry Lambert wrote: | Order of structure elements is undefined. Zero length arrays | are undefined. Also, packing is undefined. Close, but no cigar. The /order/ is defined in C89 (Section 6.5.2.1) with the following words: Within a structure object, the non-bit-field members and the

Re: A few questions about a few includes

2002-03-03 Thread Conrad Sabatier
Thanks for all the very interesting followups, folks. I learned something today! I really must start reading this list more often. :-) -- Conrad Sabatier [EMAIL PROTECTED] Bennett's Laws of Horticulture: (1) Houses are for people to live in. (2) Gardens are for plants to